From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DF6F2E88A7 for ; Mon, 8 Dec 2025 19:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765222165; cv=none; b=U5Bc17h88PIwJ9vmdEtAKTmPcHkcrmdVYANNklhhkZdKHBGkjbrmasYIRc7dOKoDxE0KJPLCMO5c5bblHTYugQAHlBoLzHBrVS+M0z6QKZ1k+QUmpXD1gXkGI/BuDVxqK0qMLM9DkIkKW1O8KAif3qHchE6vx2XT+UZ3PrAAsD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765222165; c=relaxed/simple; bh=vc022swnydaWh/KukuNdQUEaOzu4LoIXqr+Qwn3IWN0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RfnQ43NFAImhZNMavt13obTC8udJ4foawcIRILhYjilfR8lsAzi1eJCf2yxYc0BHtjUQ7X92v64dMOPNFB2jTAOt7fm8zqrkZVj/bhqffZUx20E0WpF/kbjhir7hm0ntQ1jWu5/wN6zUSSSd7jzEjh13modI1hp5TfdXXa/aG7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=omgaDKgJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="omgaDKgJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEF17C4CEF1; Mon, 8 Dec 2025 19:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765222164; bh=vc022swnydaWh/KukuNdQUEaOzu4LoIXqr+Qwn3IWN0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=omgaDKgJreyKgJLexcoMHjOwqx1MK/e5dP/JDVQ8JtQ92CSUv32+PjR1ugJgqVXTV 7cRH6SFc4bHjO674c8wHy7txXJLVzI+PkxvA5ew5S+KxPUXU/uM0pxQ69d0kpF6I68 FWqtuMpw2veFcwIldmiBnTKW0CqWhdWS/EEwfyflg1v1i0abgs33V1gSbh7tywyUSl ompLEcETY+wJOAbmFhWk9GXr3M5Y60o97QZRUfhu16xbWBtC5PsrwDWhIvw9sGEmXs wzSaEz3386mSZozz9ZBpsJx4uBZi4LKdmbCjMMDsDQz27z3HEmWUNj7X2cD0p6spmV R9He2QM6c+D6w== Message-ID: <245e6969-f45b-4d00-bf34-83da529cd3c1@kernel.org> Date: Mon, 8 Dec 2025 20:29:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/page_alloc: make percpu_pagelist_high_fraction reads lock-free To: Aboorva Devarajan , Andrew Morton , 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 References: <20251201060009.1420792-1-aboorvad@linux.ibm.com> <20251201094112.07eb1e588b6da2ee70c4641d@linux-foundation.org> From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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