[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52763118C04E83C14683CBC98C1B2@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Fri, 17 Jan 2025 06:20:15 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>, "jgg@...dia.com" <jgg@...dia.com>
CC: "joro@...tes.org" <joro@...tes.org>, "will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>, "baolu.lu@...ux.intel.com"
<baolu.lu@...ux.intel.com>, "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH rc v3] iommufd/fault: Use a separate spinlock to protect
fault->deliver list
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Friday, January 17, 2025 10:05 AM
>
> mutex_lock(&fault->mutex);
Nit. The scope of above can be reduced too, by guarding only the
lines for fault->response.
Perhaps Jason can help adjust it when picking it in.
> + spin_lock(&fault->lock);
> list_for_each_entry_safe(group, next, &fault->deliver, node) {
> if (group->attach_handle != &handle->handle)
> continue;
> + list_move(&group->node, &free_list);
> + }
> + spin_unlock(&fault->lock);
> +
> + list_for_each_entry_safe(group, next, &free_list, node) {
> list_del(&group->node);
> iopf_group_response(group, IOMMU_PAGE_RESP_INVALID);
> iopf_free_group(group);
Powered by blists - more mailing lists