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 6AA993932CF for ; Mon, 18 May 2026 20:24:23 +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=1779135863; cv=none; b=FxKMKAUBLzipIqWI6Sz9lgckqaFQm7ES0MKKQvfkZhTRCr/goa5faYTj58qVpIFHSYVzk3nNH9BJQNb+NTtcv3oyotuMt2hNmHL+vREwurp+5d4KmGBr1uoe9grcvmrWZO8l41X8ffDK65/Q35mN2lSfNEiKNp906P5w9MA48qY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779135863; c=relaxed/simple; bh=IJAKL8NTs72NKxZNZ1VjujoXmDaDDaVg2ZSqV8hIpRg=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=SNfyZc1+DSRdjQM4i0PQVfiMyM4+PoYc1imA/0leBMDRHIi2w2QVwKwhUf1nSI+lI2OYr5XX5l/jfDlaUmI9AmR32hrVfyT4zkIGjX1gH2+KP3USOosgzZ7lsl1PLCEOFEX0e5w2L93wnBzCq98lgJnZFvOYbOTECMcoe+WaOOM= 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=JSlwArzO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="JSlwArzO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A70C5C2BCB7; Mon, 18 May 2026 20:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1779135863; bh=IJAKL8NTs72NKxZNZ1VjujoXmDaDDaVg2ZSqV8hIpRg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JSlwArzOVJuRLn98yhZUKM9d36LFDaSnk7U762De8BaJXGSoOV9JNJpicKVx0hxyC Oy2i1NrsDw+3YzicrhLIoXeuCwX/l8FW3LnyDokp9pV8ncwu/E5fRszsWREuOi63WF ZM1qpg4IOE1Bf1IEyYlDiEGnzQ6/NxVAe8fVqFKU= Date: Mon, 18 May 2026 13:24:22 -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] mm/page_alloc: fix defrag_mode for non-reclaimable allocations Message-Id: <20260518132422.8cfec729a4d7e974c87ace72@linux-foundation.org> In-Reply-To: <20260518163736.173910-1-d@ilvokhin.com> References: <20260518163736.173910-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 Mon, 18 May 2026 16:37:36 +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. > > Clear ALLOC_NOFRAGMENT and retry before giving up on allocations that > cannot reclaim, following the same pattern used after reclaim/compaction > exhaustion later in the slowpath. Thanks. Sashiko asked a couple of things: https://sashiko.dev/#/patchset/20260518163736.173910-1-d@ilvokhin.com I'm not sure what to make of the first one - we aren't holding any locks in there which prevent concurrent cpuset or zonelist alterations anyway (?). But your change might violate the later comment `No "goto retry;" can be placed above this check * unless it can execute just once'?