From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 582521A285 for ; Mon, 8 Jun 2026 17:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780938411; cv=none; b=iUndD63s4YBC+PiNcz5EhmIt10KXPRbt+jWOVpq2hI8rROVEkKtu5Q+HPGCHb+zYEKKOX/ClJo6QcSyAIQoqoSPN8B8jK/MOp5kHvDbt5n0bTiOoNfMqvkmYOgXi0L3CAOes1lF8PqEq79l840N1DVbjmwKciSx4VsyjwstF/mQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780938411; c=relaxed/simple; bh=NB+WQ69LdA2KAR0XLXgws3c41jXSBZJGrZLn6RCoeyA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TmmAJBHymE+jGjlguYWok4PQFkjrvh3lKou1emlqHXAtEwJ5z/aKLGYtkZK/7s1hr5eLXljy60j9wKpKNpNjoU8IDKvGgmSknJB1obnx0MRGUZDQKRw3OMI+ImYvG+ZJmICMUTzwL0zUqxMZR2R3QhKxhuG6pGUuQdbN/PLDxXk= 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=pHY0kcV4; arc=none smtp.client-ip=95.215.58.186 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="pHY0kcV4" Date: Mon, 8 Jun 2026 10:06:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780938408; 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=HxLCTA42pe5OBef7r2AffcYmw2OMN42SHm3dbS4saMo=; b=pHY0kcV47BV16ilmop3HvzDI4xCXnAJQvVZg69ND8glUhnSfvxLgyPuqAUPBoAUmm1cP2S vdm13RoDZ7A5Cc6ZV7VibBu6yTl0mbvjaSU+7Cn7QgXhUQt5MwDVEoeVaQi+Z7fg0ZV0GW DvjjLsO9Kx3S99qPp0oOLCqM3wDEUxM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Usama Arif Cc: Andrew Morton , david@kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, tj@kernel.org, mkoutny@suse.com, 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 Message-ID: References: <20260606114158.3126210-1-usama.arif@linux.dev> <20260606114158.3126210-2-usama.arif@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: <20260606114158.3126210-2-usama.arif@linux.dev> X-Migadu-Flow: FLOW_OUT On Sat, Jun 06, 2026 at 04:41:33AM -0700, Usama Arif wrote: > vmpressure() has two outputs gated by the @tree argument: > > @tree=false drives in-kernel socket pressure (mem_cgroup_set_ > socket_pressure), consumed by TCP/SCTP. This only > applies on cgroup v2; on v1 socket memory is charged > separately via tcpmem and the consumer reads > memcg->tcpmem_pressure instead. > > @tree=true drives userspace eventfd notifications via the v1 > memory.pressure_level / cgroup.event_control interface. > v2 has no equivalent: userspace gets reclaim signals > through memory.pressure (PSI), which does not touch > vmpressure. > > The existing early return covered v1 + @tree=false. The symmetric > v2 + @tree=true case was falling through and doing the full lock / > accumulate / schedule_work / parent-walk dance for an events list > that can never be populated. bpftrace on a 176-core production host > (cgroup v2, CONFIG_MEMCG_V1=n, 285 memcgs, sustained reclaim) showed > ~16,200 @tree=true vmpressure() calls per minute. Add an early return > that skips cgroup v2 + tree = true which avoids us doing all this work. > On a v2-only host this also eliminates a lock contention path that can > serialise reclaimers on a single global sr_lock. > > Signed-off-by: Usama Arif Acked-by: Shakeel Butt