linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Aboorva Devarajan <aboorvad@linux.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	gourry@gourry.net, mhocko@suse.com
Cc: vbabka@suse.cz, surenb@google.com, jackmanb@google.com,
	hannes@cmpxchg.org, ziy@nvidia.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: make percpu_pagelist_high_fraction reads lock-free
Date: Mon, 8 Dec 2025 20:29:19 +0100	[thread overview]
Message-ID: <245e6969-f45b-4d00-bf34-83da529cd3c1@kernel.org> (raw)
In-Reply-To: <d35eca2bbdf8675c43d528571bb61c7520e669cb.camel@linux.ibm.com>

On 12/8/25 18:30, Aboorva Devarajan wrote:
> On Mon, 2025-12-01 at 09:41 -0800, Andrew Morton wrote:
>> On Mon,  1 Dec 2025 11:30:09 +0530 Aboorva Devarajan <aboorvad@linux.ibm.com> wrote:
>>
>>> When page isolation loops indefinitely during memory offline, reading
>>> /proc/sys/vm/percpu_pagelist_high_fraction blocks on pcp_batch_high_lock,
>>> causing hung task warnings.
>>
>> That's pretty bad behavior.
>>
>> I wonder if there are other problems which can be caused by this
>> lengthy hold time.
>>
>> It would be better to address the lengthy hold time rather that having
>> to work around it in one impacted site.
> 
> 
> Sorry for the delayed response, I spent some time recreating this issue.
> 
> 
> I've encountered this lengthy hold time several times during memory hot-unplug, with
> operations hanging indefinitely (20+ hours). It occurs intermittently, and it has
> different failure signatures, here's one example where isolation fails on a single
> slab page continuously:
> 
> ..
> [83310.373699] page dumped because: isolation failed
> [83310.373704] failed to isolate pfn 4dc68
> [83310.373708] page: refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dc68
> [83310.373714] flags: 0x23ffffe00000000(node=2|zone=0|lastcpupid=0x1fffff)
> [83310.373722] page_type: f5(slab)
> [83310.373727] raw: 023ffffe00000000 c0000028e001fa00 5deadbeef0000100 5deadbeef0000122
> [83310.373735] raw: 0000000000000000 0000000001e101e1 00000002f5000000 0000000000000000
> [83310.373741] page dumped because: isolation failed
> [83310.373749] failed to isolate pfn 4dc68
> [83310.373753] page: refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dc68
> [83310.373760] flags: 0x23ffffe00000000(node=2|zone=0|lastcpupid=0x1fffff)
> [83310.373767] page_type: f5(slab)
> [83310.373770] raw: 023ffffe00000000 c0000028e001fa00 5deadbeef0000100 5deadbeef0000122
> [83310.373774] raw: 0000000000000000 0000000001e101e1 00000002f5000000 0000000000000000
> [83310.373778] page dumped because: isolation failed
> [83310.373788] failed to isolate pfn 4dc68
> [83310.373791] page: refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dc68
> [83310.373794] flags: 0x23ffffe00000000(node=2|zone=0|lastcpupid=0x1fffff)
> [83310.373797] page_type: f5(slab)
> [83310.373799] raw: 023ffffe00000000 c0000028e001fa00 5deadbeef0000100 5deadbeef0000122
> [83310.373803] raw: 0000000000000000 0000000001e101e1 00000002f5000000 0000000000000000
> [83310.373809] page dumped because: isolation failed
> [83315.383370] do_migrate_range: 1098409 callbacks suppressed
> [83315.383377] failed to isolate pfn 4dc68
> [83315.383406] page: refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dc68
> [83315.383411] flags: 0x23ffffe00000000(node=2|zone=0|lastcpupid=0x1fffff)
> [83315.383416] page_type: f5(slab)
> [83315.383420] raw: 023ffffe00000000 c0000028e001fa00 5deadbeef0000100 5deadbeef0000122
> [83315.383423] raw: 0000000000000000 0000000001e101e1 00000002f5000000 0000000000000000
> [83315.383426] page dumped because: isolation failed
> [83315.383431] failed to isolate pfn 4dc68
> [83315.383433] page: refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dc68
> [83315.383442] flags: 0x23ffffe00000000(node=2|zone=0|lastcpupid=0x1fffff)
> [83315.383448] page_type: f5(slab)
> [83315.383454] raw: 023ffffe00000000 c0000028e001fa00 5deadbeef0000100 5deadbeef0000122
> [83315.383462] raw: 0000000000000000 0000000001e101e1 00000002f5000000 0000000000000000
> [83315.383470] page dumped because: isolation failed

When starting memory offlining we do a racy check whether memory 
offlining will succeed in has_unmovable_pages().

It's racy because briefly after the check, a kernel page could get 
allocated, before we isolate all the free pages.

I assume that's what happened here.

But even performing another has_unmovable_pages() check after isolating 
the free pages will not catch all cases: in particular movable pages 
that are longterm-pinned.

-- 
Cheers

David


  parent reply	other threads:[~2025-12-08 19:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01  6:00 Aboorva Devarajan
2025-12-01 17:41 ` Andrew Morton
2025-12-03  8:27   ` Michal Hocko
2025-12-03  8:35     ` Gregory Price
2025-12-03  8:42       ` Michal Hocko
2025-12-03  8:51         ` David Hildenbrand (Red Hat)
2025-12-03  9:02           ` Gregory Price
2025-12-03  9:08             ` David Hildenbrand (Red Hat)
2025-12-03  9:23               ` Gregory Price
2025-12-03  9:26                 ` Gregory Price
2025-12-03 11:28                 ` David Hildenbrand (Red Hat)
2025-12-03  8:59         ` Gregory Price
2025-12-03  9:15           ` David Hildenbrand (Red Hat)
2025-12-03  9:42             ` Michal Hocko
2025-12-03 11:22               ` David Hildenbrand (Red Hat)
2025-12-08 17:30   ` Aboorva Devarajan
2025-12-08 18:15     ` Michal Hocko
2025-12-08 19:29     ` David Hildenbrand (Red Hat) [this message]
2025-12-03  8:21 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=245e6969-f45b-4d00-bf34-83da529cd3c1@kernel.org \
    --to=david@kernel.org \
    --cc=aboorvad@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gourry@gourry.net \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox