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 E35264315A for ; Tue, 26 May 2026 13:21:19 +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=1779801681; cv=none; b=FUcXMkXCbxtBuYneOxmFsx5262rqWfhTPjkp1SBUoiykJsZfVBnynSQ8a866gkArF5ft5DY5OxkUTpckloariIQgjHzvThZlYHfINhb93u2InosFKdqw3Gqz51JAuZxiuNv4aK6wmEWAVqrtJnqvLtk1wvVCiWG0n1GBHpL49Rc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779801681; c=relaxed/simple; bh=bfvtmsJF1eJOoi1zS8Fz9C7CFIeshgLaA4i/iS4mmDk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uBbhJqLzDwuHqMPxEj8ccXahmVjr2OULaBge3pC6AhbrE0tp9tNbiPeo2x1ygH/MSYskH4wH9nOvDJQd1YA/sNeaJbDHRLRjLkRFViKlMO6QNU8196KUcPf6kWK/yj69oWT1nV/qb6ugK6tT0Te6L931XgJ5j3C0BeH22K38IvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MV9uG7Xu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MV9uG7Xu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A60E91F00A3A; Tue, 26 May 2026 13:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779801679; bh=eyoo9PJhlCAMZ6SaWhOaMZ7mhDEU+ecMvXc4liCE598=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=MV9uG7XuByY2iOTf/oPmQB6QbRFj3rw1VoYO7qfYb23HqtcxSj9BtlTHoZrFuLL6A 2C67nGTFIz4mEF8iJGCFwpYCPXHzt+nxzKUrddPlLw6UbzuvqtqM6G9Xnnl11hhRxF psHW5ah7vsX2G2arAHCNp22quyievCzooAst0AQin3J8OJkTDosckG7VczUskrMXny kMpaEdXN85zNTJgjLn2/9GAv6P/RrhAPgMQYjT5cdWbjo4Kksq9ZZw2SZccivOqsko JGPaS2z+ht9tSup/Mcl5c4IFK7dRT6gt1w0o02rVTADukOWmXkqqYj5OsIB6Dk4uH5 K6UT3H/wtfX1A== Message-ID: Date: Tue, 26 May 2026 15:21:16 +0200 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 v2] mm/page_alloc: fix defrag_mode for non-reclaimable allocations To: Dmitry Ilvokhin , Andrew Morton , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260520122228.201550-1-d@ilvokhin.com> From: "Vlastimil Babka (SUSE)" Content-Language: en-US In-Reply-To: <20260520122228.201550-1-d@ilvokhin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/20/26 2:22 PM, 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 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. > > Fixes: e3aa7df331bc ("mm: page_alloc: defrag_mode") > > Signed-off-by: Dmitry Ilvokhin > Acked-by: Johannes Weiner Acked-by: Vlastimil Babka (SUSE)