From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DE62A3C1986 for ; Thu, 21 May 2026 23:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779407954; cv=none; b=doBWt7G2kJCBFnrI8t6Hy0SMcBE8qcuUdDandiTOMU8Ki1Wd5Y9U82eZs8t6FRKjfhXRZxPPG4V+AlHWXtIMmb+Xh0un5mjNxSvcOYYwwXtn1v4PQo6+kj+qO1D8gUDD1okp822diFNtgxKnrjg6uNNP5rQQA7MfWFNi68lIxVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779407954; c=relaxed/simple; bh=J2brxVd7ck68IcFkUoQ2yqMN1WLpaDXHwm4U2VyvoSA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=mBIBeSqsb1bNsuPRu8kx3HoHzEO9GAk0qSbb5OnJerT1xNDVmZzxRdmzoDLYHCjs7S3JeBtNFMrqNI/cwcm9QAS3ILalTL4Pkmmxz38hgr06+CPJpokkDuBx9Auk4AaPAsrH+ORiM2h2dg+9wzQmezijQkhnymSz32G8/LqsU/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=iwyuwGa7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="iwyuwGa7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28ADF1F000E9; Thu, 21 May 2026 23:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1779407951; bh=jrQlxqbsZV4W/Kem03RWjAZ9GqIVBQf6LbmpMN2XAU8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=iwyuwGa76WUk5RKM/5qI/fV6PEguuuL3WXWzU5BxiitxspAQPvtS4DerZoRUUrswy F13uuWjiF9yLjvgEasymfleV0c/XWzTPzd1Nz8HAgMOyMJKpjZh2op7x8pppu+a2jM BpTLUDw8D3Jxg1azxynJDazOVVKLlnw797hadHUI= Date: Thu, 21 May 2026 16:59:10 -0700 From: Andrew Morton To: Dmitry Ilvokhin Cc: Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v2] mm/page_alloc: fix defrag_mode for non-reclaimable allocations Message-Id: <20260521165910.e7dea6a4e591d66293d2bd47@linux-foundation.org> In-Reply-To: <20260520122228.201550-1-d@ilvokhin.com> References: <20260520122228.201550-1-d@ilvokhin.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 20 May 2026 12:22:28 +0000 Dmitry Ilvokhin wrote: > When defrag_mode is enabled, ALLOC_NOFRAGMENT is enforced to prevent > migratetype fallbacks and keep pageblocks clean. The allocator relies on > reclaim and compaction to free pages of the correct type before allowing > fallback as a last resort. > > However, non-reclaimable allocations such as GFP_ATOMIC cannot invoke > direct reclaim or compaction. With defrag_mode=1, these allocations hit > the !can_direct_reclaim bailout in __alloc_pages_slowpath() with > ALLOC_NOFRAGMENT still set, and fail without ever attempting a fallback. > > This causes a large number of SLUB allocation failures for > skbuff_head_cache under network-heavy workloads, despite free memory > being available in other migratetype freelists. That sounds painful. > Clear ALLOC_NOFRAGMENT and retry for allocations that request kswapd > reclaim but cannot do direct reclaim themselves (GFP_ATOMIC). Purely > speculative allocations like GFP_TRANSHUGE_LIGHT that don't set > __GFP_KSWAPD_RECLAIM are left to fail, since they have reasonable > fallbacks and should not cause fragmentation. How serious is this to our users when running real-world workloads? > Fixes: e3aa7df331bc ("mm: page_alloc: defrag_mode") > > Signed-off-by: Dmitry Ilvokhin > Acked-by: Johannes Weiner