From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E414548A8BE for ; Thu, 6 Aug 2026 18:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786040710; cv=none; b=OFRB3JUJJXu2pbekWjIwscvHKUJzIGHzzm1qLmiInxz4sOVgwQnE/cp8bvbXk7Zxl1ODMLssiO6WRJSBUoVNNMVm4ts5S3CaAEXJKBTlbM10IjgzWls45+evoV4DNTk49u4LhI6PXN2IHZ9qypErm9LBb4NPk42PklVDGsGmx68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786040710; c=relaxed/simple; bh=OAnGXhoMWN0VX4aRXp3qSN6EwUoruIJ70j69kxghWfM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GreeK/jo8q5119S9SnG68FUldJ02FnQ0wBGw7bVS+n4zn3oSCVjxFQstCZK3X42pULMdjaTLwqwhctElVknGIoF9ARq0aWy7kftMoPpA2r18apnL0fQxitk0Q/OrqnvBUVwWK2bWi1WgMcxUCWOno7PhT1sHB5cKB/zsc3wTP38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rNN3IMG1; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rNN3IMG1" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-3856d6fbcb3so2087487a91.2 for ; Thu, 06 Aug 2026 11:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786040708; x=1786645508; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=eRxIpMxQf2eH73MswyccHSNChNNfT/J5n/NCnkKxEHE=; b=rNN3IMG1BNlGchnOjZlFZrkh2BI0nTwD6or5ACQrLo2bfQYsxI4LX8sKNjYEiew29w d7NlyengXoAoaRY6LL8O8zFGtGG8r1dXVYGAr4hzEGxxYD8AH+Ojh00kISYTcYrQvwST Pb3jXyPVZMU8MusBD+A0pIPluCWmxCH4Y9gfY3nLdG2RPWH9mzPXo1lxSeVFyTRasuV3 jI+iII9LvtQHQLRX5lilQEw2PrhRsj62shYDOvIGX+lIJCKoODd5h12wLoalfAw+qBEd MsrtW4hsc0krY8hWLd88cS/kL0J1Iuj7Cnh2ngid9CB2RirbLRXCBopExXv2KwP/nOLp h7GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786040708; x=1786645508; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=eRxIpMxQf2eH73MswyccHSNChNNfT/J5n/NCnkKxEHE=; b=WrfO2Drd7KjJ9TGN6OdSi6UlsGcxl5IJJACSVVhrkelFQP/VPAmX2aicbmFp3+yUNc 22rrSiRgkH++Z9tptqTmN9zrvUEBaeQFd8zo/Mp67rNwjxM91Ux6Hbga6WKo6AQNm0kL 2B3J0TiU0JPdf8XpxF4I/Pbakh5SkipjmXVP2PVbchBuGD9x1qcJ0fwZexN/P+vUF4yC 14Jk8mL3kSbLiDD0nN7wrUBXxiRQubrbXliggMD8yVuDTHnX23QSdZ1zDHBBJCybLr6f vIzcsdrjY/NgIF8mFGwN0HQ7XZJ7lKNlV8IUN0/9ieQ4yamRGiYdgBRFuobP2rTbuy2A rJBQ== X-Forwarded-Encrypted: i=1; AHgh+RrLe66QSiSsqcpDA94aXbpi0Vkg5wE0Ngz+R+70+WOdnej/pf0DJq4QvB1wlsL9d5ZjRZvHetgQ1jQJAkg=@vger.kernel.org X-Gm-Message-State: AOJu0YzYCoA6jHY7PznY/1aUjVqDh7HtVZPtD/yN5Y/sD0Ts5TPvYMtH x+D/w3BMJ4vrwJnDLKWZuYFOqxyvSR067N1gaS6wxEL04VXeH7koc+fw X-Gm-Gg: AR+sD13DklLaMkulqLXLt5l7SaW3hBhl9U6ZBdCJtifSnz3V7tT0d3HqOlYt88p+p5C ymV8YyQauOGiMJkabYKnSTPMrWj36BE/q/9yevBwYa+alkg2WnNwNheFmR8N5g66H3dw6bTYFUa W+IiuugXtmlv2Udk+3xC2a3OG3Tw7genMiHe5qFUKtBqNXu4p88Tf/BAdcEix3/Eiz1QEZEKvdk vDx5QgJVmW5d7vhyPmtWCOhnLzrNAXTRwDqz/U+dK40lZiI96YpwvJ8MlN+HpoW331j1qj+JpUI jAQcfxpcM9S+19JGkAwR9vEfirkW+2RbxGuOpvY9Q33kKC6GN+2tdnYn7Vyh629KxQREU7q1heL HZ2fg5NBE3ZgKzp/6pkUZKBXaRSMIh+JH4aCJoHfbDlirsOhuaaew2T1TONlVy5QX88tRtrNjp5 FpY2Gb57y6f+vMIQ9h7sgED55HUgPuU2flBcLz4oUjLxHJFhZwX6c4g8p8sHR2lthORItI1Ufm7 blNnYo7 X-Received: by 2002:a17:90b:3889:b0:381:973e:fa08 with SMTP id 98e67ed59e1d1-3903c5cfba2mr14353244a91.18.1786040708017; Thu, 06 Aug 2026 11:25:08 -0700 (PDT) Received: from devvm16600.scu0.facebook.com ([2a03:2880:9ff:6e::]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-315867bc261sm29668669eec.28.2026.08.06.11.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 11:25:07 -0700 (PDT) Date: Thu, 6 Aug 2026 11:25:04 -0700 From: Ziyang Men To: JP Kobryn Cc: Shuah Khan , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Jiri Kosina , Benjamin Tissoires , David Vernet , Eduard Zingerman , Andrea Righi , Changwoo Min , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Mykola Lysenko , Nathan Chancellor , linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, linux-input@vger.kernel.org, sched-ext@lists.linux.dev, linux-mm@kvack.org, kernel-team@meta.com, bpf@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] selftests/cgroup: add memcg_stat_cross_cpu correctness test for flush Message-ID: References: <20260721174833.1232771-1-ziyang.meme@gmail.com> <20260721174833.1232771-3-ziyang.meme@gmail.com> 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; format=flowed Content-Disposition: inline In-Reply-To: On Wed, Jul 22, 2026 at 11:42:58AM -0700, JP Kobryn wrote: >On 7/21/26 10:48 AM, Ziyang Men wrote: >>Add a test_progs selftest that verifies the memory-cgroup BPF kfuncs >>return values that agree with what userspace reads from cgroupfs, across >>a whole cgroup subtree that has been charged on many CPUs. >> >>It complements the existing cgroup_iter_memcg test. cgroup_iter_memcg >>calls the memcg kfuncs on a single cgroup (BPF_CGROUP_ITER_SELF_ONLY) and >>only asserts each value is greater than zero, so it never checks that a >>value is actually correct. This test compares the kfunc values against >>what userspace reads from memory.stat, and checks every node in the >>cgroup tree. >> >Can you extend the existing test instead of adding a new one? Hi JP, Good suggestion. Actually extending the exisiting one was the plan in the v1. However, existing selftests with similar purpose is the cgroup_iter_memcg, which is in the bpf/. After discussed with the bpf reviewer in v1, we think this selftest may suit better in the cgroup/ rather than the bpf/, since 1) it tests the cgroup functionalities (bpf is a tool), and 2) together with the selftest, this patch serials also ships a common Makefile lib.bpf.mk for easily compiling selftests for other subsystems using bpf. Currently there is no other selftests in cgroup/ relies on BPF and we think it is good to put this selftest here as the first consumer. We appreciate any possible suggestions. Thanks very much! Best, Ziyang