From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 E72BE2737E3 for ; Fri, 3 Apr 2026 01:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775178235; cv=none; b=QYmP5YU4pFU0Z3gYeanoUKnbU1hsL6QsIf6R3Or29eR5vu/FmEHmkJs5FGJ7mBKaAwrQQFJMVeSYpg1NCgoVk4PVctoHwInx4+UEVnTdlP3e2LyoijfJrb+DAbk+zxW14CrVOSSaPBBbFyYyyeN6p6BRJIE6byRt52jYhmw3qOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775178235; c=relaxed/simple; bh=1LdY924vImLVp8wuouo5L+CLn7ldDb4dU8H3KLLBkFw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o/1ZFFfTChG7yaWRtCqWLQAMuTxmN7+XRKdq08tjPWDylKHWyKRaBNhQoVqL1DoK0gaapHOFjAnoqJrCFlTuSqat6tIgeTNoyE9ZwUNBgDEMxIkHxRM6S02clA8g1ZSOSPH75u7REwg9ps4CavIQ43QR7wuQ1lUvJoL8rd8sjpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Z/MxJZPP; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Z/MxJZPP" Date: Thu, 2 Apr 2026 18:03:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775178230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=53BQQ0sHBNvn674bx/yqTRF2ETsE2dMIOa2LRdAyEbE=; b=Z/MxJZPPnsX8EwiAvUnTfqMgeFGfJRCzrXPTm8DTel/l7vcNI33UAbPJY/rnSxrwBZwfD6 qi+IXFa4TWtZcl70sQi+mYuc+Aupau0+ryjaj6kb9uWyJ4qmh17WH9eFz/PFvdDB0BWnZb r/U5c7QJdQE+LDZMppnM17iGrgepiHw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: "JP Kobryn (Meta)" Cc: linux-mm@kvack.org, willy@infradead.org, hannes@cmpxchg.org, akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, kasong@tencent.com, qi.zheng@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, riel@surriel.com, kuba@kernel.org, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v2] mm/vmpressure: skip socket pressure for costly order reclaim Message-ID: References: <20260402232511.17246-1-jp.kobryn@linux.dev> 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-Disposition: inline In-Reply-To: <20260402232511.17246-1-jp.kobryn@linux.dev> X-Migadu-Flow: FLOW_OUT On Thu, Apr 02, 2026 at 04:25:11PM -0700, JP Kobryn (Meta) wrote: > When kswapd reclaims at high order due to fragmentation, * kswapd is woken up for the higher order reclaim request But this can be direct reclaim as well. > vmpressure() can > report poor reclaim efficiency even though the system has plenty of free > memory. This is because kswapd scans many pages but finds little to reclaim > - the pages are actively in use and don't need to be freed. The resulting > scan:reclaim ratio triggers socket pressure, throttling TCP throughput > unnecessarily. > > Net allocations do not exceed order 3 (PAGE_ALLOC_COSTLY_ORDER), Net not doing costly order allocations is irrelevant here. IIUC you want all costly order allocations (like THPs) to not raise vmpressure as those don't necessarily represents the memory pressure. > so high > order reclaim difficulty should not trigger socket pressure. The kernel > already treats this order as the boundary where reclaim is no longer > expected to succeed and compaction may take over. > > Make vmpressure() order-aware through an additional parameter sourced from > scan_control at existing call sites. Socket pressure is now only asserted > when order <= PAGE_ALLOC_COSTLY_ORDER. > > Memcg reclaim is unaffected since try_to_free_mem_cgroup_pages() always > uses order 0, which passes the filter unconditionally. Similarly, > vmpressure_prio() now passes order 0 internally when calling vmpressure(), > ensuring critical pressure from low reclaim priority is not suppressed by > the order filter. > > Signed-off-by: JP Kobryn (Meta) The patch looks good. I think we can ask Andrew to just adjust the commit message and then you don't need to resend. Moving networking stack away from vmpressure in my plan for a long time and this tells me I should get to it sooner. Acked-by: Shakeel Butt