Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795917253; b=WXWlwzh8jlW/xwVbIQE4HZ8xburulAwAV/0S0PEqyvb9hG6C0xZsXoflNlNPJkbdSe7x es+k88rnMSSYYjXdfZb3v2S06iG/dLlAbrGKELPgCX3k1LkFP9jNayRw6ONM0xkII43Jb CFNRiU4CNP3BvuAtDnTLjmx/SD4WtmrljtMjZH4MaaLiW4uk3+rqUxMUCZaOdUCMDLMgg 5hpIfF4MTqtnY+g9atOxq+agiafOO97Bz7HoJAb6YPiwXjNBUukVIoKja3MWW1NQXA2Oy O364nK0xL7O/tWqGU7xss9frRg8p7wUlrjqGxfi7DWG8K8nMqCcH7pwzB4NrhawHqBQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795917253; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=whr+FwWKiDUwhL+L1xu0Te0nAc59fyyFee16UC4dWSo=; b=FXnkyowaCohH+GRVvKzy8eCS18oinpV9Tf6Fe128ysyDblHBn49NQ5lMjQ7CSB2lEuh5 DCQ1SpMKgPyYttg8+m0nvCuFUzmIZXWwfXcrRQc5GYjylerqUdXepVpw50mQ83CZ+xBUZ APRmYQuIZl2VuLYZu2iP20QP1oX/NdYupAIY/z4D6XZdp80WHfKRNU1qq3QSKlYQh6bkU q17edwGxRHq8MINt5jIfKWrdbkdicMnL/Y930CoUVQOY8Xkc5r6iq7q1EvLJSM50XNIRn OUVugdAWg4Pw3wyZLxWTqvai1kR+7C9V1g4IZJBjpjIlM5PbRkuiwquJX9N4j26WRgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=cvVPo7le; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE142606A31C for ; Sun, 29 Nov 2026 01:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=cvVPo7le Received: by smtp.kernel.org (Postfix) with ESMTPSA id 639E01F00896; Sun, 29 Nov 2026 01:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1795917252; bh=whr+FwWKiDUwhL+L1xu0Te0nAc59fyyFee16UC4dWSo=; h=Date:To:From:In-Reply-To:References:Subject; b=cvVPo7leCp6UNNycBwK6UuKxbq5YsK3uhzsz4sX1X6zPaOoiTLgyaJBaYDinPu4wh X9Q1lqc69Jr9GbNOU7WomRyaE/RJv+XpZxwoRsA7/s9QYmpSUPuULBmj+HoEmXwoSH LYloPxltya2A3N3LPI8aUFHw1jQ+KSYt+bbYq9z0= Date: Sat, 28 Nov 2026 17:54:11 -0800 To: mm-commits@vger.kernel.org,vbabka@kernel.org,surenb@google.com, shakeel.butt@linux.dev,rppt@kernel.org,riel@surriel.com,mhocko@suse.com, ljs@kernel.org,liam@infradead.org,kuba@kernel.org,jp.kobryn@linux.dev, hannes@cmpxchg.org,david@kernel.org,baohua@kernel.org, xueyuan.chen21@gmail.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261127-socket_pressure-v1-1-1d3a60c1dbb7@gmail.com> References: <20261127-socket_pressure-v1-1-1d3a60c1dbb7@gmail.com> Subject: + mm-vmpressure-exclude-costly-order-reclaim-from-socket-pressure-accounting.patch added to mm-unstable branch Message-Id: <20261129015412.639E01F00896@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm/vmpressure: exclude costly-order reclaim from socket pressure accounting has been added to the -mm mm-unstable branch. Its filename is mm-vmpressure-exclude-costly-order-reclaim-from-socket-pressure-accounting.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmpressure-exclude-costly-order-reclaim-from-socket-pressure-accounting.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Xueyuan Chen Subject: mm/vmpressure: exclude costly-order reclaim from socket pressure accounting Date: Fri, 27 Nov 2026 20:27:02 +0800 vmpressure() accumulates reclaim statistics but only checks the order of the last sample when closing a window. As a result, costly-order reclaim can still trigger socket pressure indirectly or discard accumulated low-order reclaim statistics. Skip costly-order reclaim before updating the counters. Link: https://patch.msgid.link/20261127-socket_pressure-v1-1-1d3a60c1dbb7@gmail.com Fixes: f2a950170f7a ("mm/vmpressure: skip socket pressure for costly order reclaim") Signed-off-by: Xueyuan Chen Signed-off-by: Andrew Morton Acked-by: Shakeel Butt Reviewed-by: Rik van Riel Cc: David Hildenbrand Cc: Lorenzo Stoakes Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Barry Song Cc: JP Kobryn Cc: Johannes Weiner Cc: Jakub Kicinski mm/vmpressure.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/mm/vmpressure.c~mm-vmpressure-exclude-costly-order-reclaim-from-socket-pressure-accounting +++ a/mm/vmpressure.c @@ -156,6 +156,14 @@ void vmpressure(gfp_t gfp, int order, st if (!memcg || mem_cgroup_is_root(memcg)) return; + /* + * Costly-order reclaim relies on compaction, so its efficiency + * is a poor signal for socket pressure. Exclude these samples + * before they can affect the window. + */ + if (order > PAGE_ALLOC_COSTLY_ORDER) + return; + spin_lock(&vmpr->sr_lock); scanned = vmpr->scanned += scanned; reclaimed = vmpr->reclaimed += reclaimed; @@ -168,15 +176,7 @@ void vmpressure(gfp_t gfp, int order, st level = vmpressure_calc_level(scanned, reclaimed); - /* - * Once we go above COSTLY_ORDER, reclaim relies heavily on - * compaction to make progress. Reclaim efficiency was never a - * great proxy for pressure to begin with, but it's outright - * misleading with these high orders. Don't throttle sockets - * because somebody is attempting something crazy like an order-7 - * and predictably struggling. - */ - if (level > VMPRESSURE_LOW && order <= PAGE_ALLOC_COSTLY_ORDER) { + if (level > VMPRESSURE_LOW) { /* * Let the socket buffer allocator know that * we are having trouble reclaiming LRU pages. _ Patches currently in -mm which might be from xueyuan.chen21@gmail.com are mm-zsmalloc-remove-config_zsmalloc_stat.patch mm-vmpressure-exclude-costly-order-reclaim-from-socket-pressure-accounting.patch mm-memcontrol-expose-anon-and-file-reclaim-statistics-in-memorystat.patch