From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A92A2CA5FE6 for ; Fri, 2 Oct 2026 22:28:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAC066B0088; Fri, 2 Oct 2026 18:28:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5DBB6B008A; Fri, 2 Oct 2026 18:28:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9738D6B0092; Fri, 2 Oct 2026 18:28:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7D7EA6B0088 for ; Fri, 2 Oct 2026 18:28:29 -0400 (EDT) Received: from smtpin06.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F10EA8087F for ; Fri, 2 Oct 2026 22:28:28 +0000 (UTC) X-FDA: 85279126296.06.46A7EDF Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf12.hostedemail.com (Postfix) with ESMTP id 3212D40006 for ; Fri, 2 Oct 2026 22:28:27 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=O1lDm6z9; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1790980107; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nL/ZJzb+eWbYYnb+iW2qc4P7Usj9ljnxOgkJ0BBDdVg=; b=x275ZOqiFgHV3dcTMDTe22OBXzECB4Nae6seiLIeHOnR54pEPm2a90La6PInBde2vzu5Ag bs2ABvtNKO92XFhw+py47oCaLrIdPVhDmlhwObx6hzBkTN9Nbxcz49YH8ayMm1SAaZrAub YV81c0jRpRzRUSBBmuMivi0KZzr9MW4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=O1lDm6z9; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1790980107; b=5ZEr7gr3j8AHL9nUHjq6J+2Z+mfe+2mVOos4/B0vf94nGjhksZ3+v5X2zdvmNVgfXBj33+ X0MWNhe64PqmQ6YM6V/k+knIglAK+bkcnmo9sycO70foArSHR+4sLg/NSjlLjwFN2hSprH O1DJUfOd4sCDr8pIJMAgywRi5eyprhw= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4A30241143; Fri, 2 Oct 2026 22:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A6541F000FF; Fri, 2 Oct 2026 22:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1790980106; bh=nL/ZJzb+eWbYYnb+iW2qc4P7Usj9ljnxOgkJ0BBDdVg=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=O1lDm6z9hrvgFknTcEbmBpb4kZzRIzRb8Cr+61QGKNVqw/CHTSV63wzhcCKewo2J1 DiHXB9/F2ZR9jNGkNtvHjB5UkDVW9WMXLab0F4UifDDpVbMz0X4MhStvSslG0kkdgf ALLCyTzr3PNj0nWSdJMaPhu+3bFzASE5W/F01Zkg= Date: Fri, 2 Oct 2026 15:28:24 -0700 From: Andrew Morton To: "Vlastimil Babka (SUSE)" Cc: Salvatore Dipietro , linux-kernel@vger.kernel.org, hch@infradead.org, abuehaze@amazon.com, alisaidi@amazon.com, blakgeof@amazon.com, brauner@kernel.org, dgc@kernel.org, dipietro.salvatore@gmail.com, djwong@kernel.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, mhocko@suse.com, ritesh.list@gmail.com, rvvandan@amazon.com, stable@vger.kernel.org, surenb@google.com, willy@infradead.org, ziy@nvidia.com, David Hildenbrand , Christoph Hellwig , Dmitry Ilvokhin , Brendan Jackman Subject: Re: [PATCH v6] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Message-Id: <20261002152824.75ee2a39f5b705a85123ea74@linux-foundation.org> In-Reply-To: <42d1a163-3502-49b8-9a27-7df9d06eee64@kernel.org> References: <20261001082152.2879289-1-dipiets@amazon.it> <20261001182942.ce99faa753fb9d9bd2efec1e@linux-foundation.org> <42d1a163-3502-49b8-9a27-7df9d06eee64@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 3212D40006 X-Rspam-User: X-Stat-Signature: wmtg4arb6e4x6ofxz3645yckrro93wog X-HE-Tag: 1790980107-692174 X-HE-Meta: U2FsdGVkX1/CJ8qKPxU0kamBK+m2ya5cMBjDTOo1JQBWST0kqblZdpDZmCF4KxV9/WdTe1bMRp97UqJHB3Z+ZZqpUP9Cv+qsNg4AmCm+/enN37PMJKaN0/XNPBVW9rH4dDZWfxDtYc6FOFhps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9WjqdJ1dYdruw3qq6P8+RDIqTGpirePcHqdlfWkoNB5MYucXBG7Ixep0iU+cTuAAD6ntrmwQjtIpAtRt6/f+h9VmCkh+i0iPEva1CdSu1wtLDA0dQJEuRyDKuhZCHyi+aYhQFgTCWDN/dQxF7KveQw= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, 2 Oct 2026 10:23:47 +0200 "Vlastimil Babka (SUSE)" wrote: > On 10/2/26 03:29, Andrew Morton wrote: > > On Thu, 1 Oct 2026 08:21:51 +0000 Salvatore Dipietro wrote: > > > >> Commit 5d8edfb900d5 ("iomap: Copy larger chunks from userspace") > >> introduced high-order folio allocations in the iomap buffered write > >> path. When memory is fragmented, each failed costly-order allocation > >> enters __alloc_pages_slowpath() which runs direct reclaim, direct > >> compaction and drain_all_pages(), causing a 0.38x throughput drop on > >> PostgreSQL pgbench (simple-update) with 1024 clients on a 96-vCPU arm64 > >> system. > >> > >> The root issue is that direct reclaim and direct compaction are too > >> expensive for hot allocation paths that have fallbacks to smaller > >> allocations. __filemap_get_folio_mpol() already marks higher-order > >> allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the > >> caller can handle failure. However, the page allocator still enters the > >> full blocking slowpath for costly orders with __GFP_NORETRY, which is > >> unnecessarily aggressive when the caller will simply retry at a lower > >> order. > >> > > Since it expands the impact of a pre-existing bug of nonblocking allocation > eating reserves [1] it shouldn't proceed to mainline without a fix for that > (Johannes posted it there but the review discussion got stalled). > > > Thanks, I'll update mm-hotfixes to this version. > > I've also argued for not handling it as a hotfix [2] > > [1] https://lore.kernel.org/all/9f415dc7-adad-4161-b20d-7c3173f50ff3@kernel.org/ > > [2] https://lore.kernel.org/all/c6e2c1e1-a285-406e-a2b6-c09e05df91d8@kernel.org/ > Thanks. I moved this to tail of mm-unstable, removed its cc:stable and added a note indicating that changes are expected.