Re: [PATCH 3/5] iommu/s390: Use RCU to allow concurrent domain_list iteration

From: Jason Gunthorpe
Date: Tue Oct 18 2022 - 11:18:50 EST


On Tue, Oct 18, 2022 at 04:51:30PM +0200, Niklas Schnelle wrote:

> @@ -84,7 +88,7 @@ static void __s390_iommu_detach_device(struct zpci_dev *zdev)
> return;
>
> spin_lock_irqsave(&s390_domain->list_lock, flags);
> - list_del_init(&zdev->iommu_list);
> + list_del_rcu(&zdev->iommu_list);
> spin_unlock_irqrestore(&s390_domain->list_lock, flags);

This doesn't seem obviously OK, the next steps remove the translation
while we can still have concurrent RCU protected flushes going on.

Is it OK to call the flushes when after the zpci_dma_exit_device()/etc?

Jason