Re: [PATCHv2 2/5] pci: make pci_destroy_dev concurrent safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 02, 2024 at 07:34:13PM -0700, Davidlohr Bueso wrote:
> On Tue, 27 Aug 2024, Keith Busch wrote:
> 
> > +static inline bool pci_dev_test_and_set_removed(struct pci_dev *dev)
> > +{
> > +	return test_and_set_bit(PCI_DEV_REMOVED, &dev->priv_flags);
> > +}
> 
> Same ordering/dependency description observations as mentioned in
> patch 1 (both these cases are fully ordered).

Just rebasing everything so late reply here.

test_and_set_bit already has a memory barrier. It's the "set_bit" that
doesn't, but set_bit is not used for this new flag. This new flag only
indicates the device is being removed, so it's only set once before the
device is deleted. It's never accessed outside this path, and it's
safe compared to looking at the kobj parent.




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux