From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.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 258CD400E0B for ; Mon, 29 Jun 2026 12:35:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782736549; cv=none; b=NW4bAkwx5tHCkT1ynCH9ZN6DmHv1yN2jyaUG5uJMaubEjkxuDESCri3GBhFFG33M0Xs0+g6LEHN2TcQOm7B8Yf0SfzCnFL0B0GJ3u9hNZf741tmdTmqeElSQZWMaw1tqTjjP111Dk+DU5BSImHnambiqcBCesagP7Xefw7bluUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782736549; c=relaxed/simple; bh=kEFmge0ZpYqdnFaqASTWC8Oem9E3/dXlfuv9hj/0XkQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dKbWEOhKYVR+kTlgdH4uG+AB6grJ8uXJ3391x/2iElS0VvUts7g3pPOK4UcjUlatPcY9wdURNijoEs7sR/I1ou87I3bJMCG36ieI5bLZUOC2p9rN2m11LbS4QYfzpTNd/PXbEJLilIc9khAz68g8LX2VoIV2AYBOAitAmtdV5RI= 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=mamFXK5l; arc=none smtp.client-ip=95.215.58.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="mamFXK5l" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782736545; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=opehZDGpTitGHCW3KLQ03Dmka13u7l/NNBz83U1Ssck=; b=mamFXK5lCyd6VO7MKQp7ZipL78nOeRCOVQ7oELE4VpvfjQngRj22XzOSpN27NExPwzsrlc CSg3QI1rZxXFoMoRrROhLB0slZxnkq/HX1+2RBWwr7wiabUjoNyB2qodXv3F9ktXopMgV0 HOFEnlRgZaAF2vZXRSwMjLj24ueZjTA= From: Usama Arif To: =?UTF-8?q?Michal=20Koutn=C3=BD?= Cc: Usama Arif , Andrew Morton , david@kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, tj@kernel.org, shakeel.butt@linux.dev, roman.gushchin@linux.dev, liam@infradead.org, linux-kernel@vger.kernel.org, ljs@kernel.org, mhocko@suse.com, rppt@kernel.org, surenb@google.com, vbabka@kernel.org, kernel-team@meta.com Subject: Re: [PATCH 1/2] mm/vmpressure: skip tree=true accounting on cgroup v2 Date: Mon, 29 Jun 2026 05:35:32 -0700 Message-ID: <20260629123535.1663050-1-usama.arif@linux.dev> In-Reply-To: References: 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=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Thu, 25 Jun 2026 11:04:15 +0200 Michal Koutný wrote: > Hello Usama. > > On Sat, Jun 06, 2026 at 04:41:33AM -0700, Usama Arif wrote: > > --- a/mm/vmpressure.c > > +++ b/mm/vmpressure.c > > @@ -246,11 +246,13 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgroup *memcg, bool tree, > > return; > > > > /* > > - * The in-kernel users only care about the reclaim efficiency > > - * for this @memcg rather than the whole subtree, and there > > - * isn't and won't be any in-kernel user in a legacy cgroup. > > + * Only two combinations have a consumer: > > + * cgroup v2 + tree=false -> in-kernel socket pressure > > + * cgroup v1 + tree=true -> userspace eventfds (memory.pressure_level) > > + * Skip the other two: nothing consumes the result. > > This is a good finding, I had some troubles convincing myself that the > v2 has really only the memcg->socket_pressure. I think swapping the > order of the patches would make it easier to comprehend. Thanks Michal! I realized when trying to swap the order that the splitting off v1 commit will end up doing more that what I think it should do (just splitting off v1 specific code), as the tree = true code will not get compiled in at all for cgroup v2, and it then ends up changing more behaviour. I am sending the next revision with the current order, but if you have a strong preference, I will respin with the order reversed. > > > Michal >