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

From: Andrew Morton

Date: Thu Apr 30 2026 - 11:54:14 EST


On Thu, 30 Apr 2026 15:59:33 +0800 Muchun Song <muchun.song@xxxxxxxxx> wrote:

> >> Lockdep would flag this as sleeping while atomic when acquiring mutex I think.
> >
> > Another thought would be, that we always call the inc/sub from memory failure
> > code while we hold a folio reference and the page is not poisoned yet.
> >
> > That way, memory offlining cannot continue and the memory block cannot go away.
> >
> > So we'd let out page reference keep the memory block alive.
>
> It seems unnecessary to hold lock_device_hotplug if the user already holds a
> refcount on the page. I'd like to drop this patch.

Dropped, thanks.

mm-hotfixes-unstable still has

"mm/memory_hotplug: fix memory block reference leak on remove"
and
"drivers/base/memory: fix memory block reference leak in poison accounting"