[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c650dcb-294b-975a-9836-05973f9ea852@linux.intel.com>
Date: Tue, 8 Feb 2022 12:55:07 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc: baolu.lu@...ux.intel.com, Joerg Roedel <joro@...tes.org>,
Kevin Tian <kevin.tian@...el.com>,
Ashok Raj <ashok.raj@...el.com>, Liu Yi L <yi.l.liu@...el.com>,
Robin Murphy <robin.murphy@....com>,
Jason Gunthorpe <jgg@...dia.com>,
Christoph Hellwig <hch@....de>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 09/10] iommu/vt-d: Refactor dmar_insert_one_dev_info()
On 2/8/22 2:27 AM, Jacob Pan wrote:
> Hi BaoLu,
Hi Jacob,
>
> On Mon, 7 Feb 2022 14:41:41 +0800, Lu Baolu <baolu.lu@...ux.intel.com>
> wrote:
>
>> static void intel_iommu_release_device(struct device *dev)
>> {
>> - struct intel_iommu *iommu;
>> -
>> - iommu = device_to_iommu(dev, NULL, NULL);
>> - if (!iommu)
>> - return;
>> -
>> - dmar_remove_one_dev_info(dev);
>> + struct device_domain_info *info = get_domain_info(dev);
>> + unsigned long index = DEVI_IDX(info->segment, info->bus,
>> info->devfn);
>> + xa_erase(&device_domain_array, index);
>> + dev_iommu_priv_set(info->dev, NULL);
>> set_dma_ops(dev, NULL);
>> + kfree(info);
> Now that info and sinfo are under RCU, should we use kfree_rcu?
Yes. We should use kfree_rcu.
Best regards,
baolu
Powered by blists - more mailing lists