Re: [PATCH v2 3/3] drivers/base/memory: fix locking for poison accounting lookup

From: Oscar Salvador

Date: Tue Apr 28 2026 - 05:58:29 EST


On Tue, Apr 28, 2026 at 04:52:19PM +0800, Muchun Song wrote:
> memblk_nr_poison_inc() and memblk_nr_poison_sub() call
> find_memory_block_by_id(), which requires device_hotplug_lock to
> serialize the xarray lookup against memory block removal.
>
> Take device_hotplug_lock around the lookup and nr_hwpoison update so
> the memory block cannot disappear between xa_load() and get_device().
>
> Fixes: 5033091de814 ("mm/hwpoison: introduce per-memory_block hwpoison counter")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>

It might have made sense to join both patches? Anyway:

Acked-by: Oscar Salvador <osalvador@xxxxxxx>


--
Oscar Salvador
SUSE Labs