[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v11 02/17] pci: introduce per-domain PCI rwlock
On Sat, 2 Dec 2023, Volodymyr Babchuk wrote: > Add per-domain d->pci_lock that protects access to > d->pdev_list. Purpose of this lock is to give guarantees to VPCI code > that underlying pdev will not disappear under feet. This is a rw-lock, > but this patch adds only write_lock()s. There will be read_lock() > users in the next patches. > > This lock should be taken in write mode every time d->pdev_list is > altered. All write accesses also should be protected by pcidevs_lock() > as well. Idea is that any user that wants read access to the list or > to the devices stored in the list should use either this new > d->pci_lock or old pcidevs_lock(). Usage of any of this two locks will > ensure only that pdev of interest will not disappear from under feet > and that the pdev still will be assigned to the same domain. Of > course, any new users should use pcidevs_lock() when it is > appropriate (e.g. when accessing any other state that is protected by > the said lock). In case both the newly introduced per-domain rwlock > and the pcidevs lock is taken, the latter must be acquired first. > > Suggested-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> > Suggested-by: Jan Beulich <jbeulich@xxxxxxxx> > Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx> > Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |