RE: [PATCH rc v3] iommufd/fault: Use a separate spinlock to protect fault->deliver list
From: Tian, Kevin
Date: Fri Jan 17 2025 - 01:20:45 EST
> From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> 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);