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 E420548A8D3 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=OMWh6bHEkMEn7AYO5S2erha4Iec2LCEQL+QRRUAepxYiAfD7zhHuE0YrTNj9v7LR2lYqgzDSo86xStwCVUxBJWIX0+j4hlRExzAp8x/23SXs/YLcOU4HFDuc+0q5ndvql2zLoUpcQLfhfcjEM3OkRnp1nkD0Ri8Hi64Eepr8OcE= 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=VidZnLnF; 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="VidZnLnF" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-38de840f2f0so1873285a91.0 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=lists.linux.dev; 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=VidZnLnFrbxlqpZD1gGqU8QPPGNglGM7Z3d4wamTD9N9lEVNJ4ZdvTk85xXbKj+m9X C3GUJx9wEbD1A18sHNxKcsRNU5DRRiSmma04EsAcXBxyFNdSKI0/h7el4ctizQMevkqJ 4eAAn5iRdbep1wJFCceY3lnHI72qYJLhDotToJ84/DmJ6NhNwFjkCfrO+QqgJGpDiWqZ bSE1aP7LtkfCpVy47KB8aT7URJAUcvLU0RyCCr9S/2/VhwPCCZ7ZMVW8KiRskEgrqey3 Oe4rEoZ2UQuFFJJYFNz60ygyCLcov48bClNyHv9F4unDDzvajp4nERnUfHD6uwJqB3kR D+Nw== 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=BcV6i5EvlWLis4ASRwWHMNheXe2raazmRm4AiBjSjSgroLX/a9ysny8OYCDruVR8V7 WB8sm0UH7hTeiENf0DmbUxFEFdoX39yMRLqkZcFjVPI7IWaOEIm7tqmah+TgDuBoR/Uv SHjsYaV6xJo6kTAg5+q/9Ei34yIHRJOBfc4XAt6AIqqCwsODhmPgQDtMlv7+YYjXjVm3 Vu5nE1qV9FJsIF1OxNAL+Jg28C6E3SVleTQHrqEvpVATdxL6T/ON96ZH1zLGHA35OSD1 UuSBq8OqbE9q9LDc7SKD+udN8EdKb0sCji3zecIUgu5+ESDZFiXAuSo2y8QbRCzBl0wE Edcg== X-Forwarded-Encrypted: i=1; AHgh+RrLZ01ytenH5zoeZdMcC3/+pj9YPoidD8XO2Y7oSPXD9Xu5qd1RdR2hJ/EtJ2J0aYbfCWrUTy1yUWc=@lists.linux.dev X-Gm-Message-State: AOJu0Yw9IUleoGuAPl9xbleVzQeY8MIpoTiEBRC3NKdVbcdvAuLiWylq ZqnRiCcRtLjiz6XdjjtAkpmanVbw/KD4NBQ0gXu/kdqbKpSiHgVbP0Fu X-Gm-Gg: AR+sD12wLSw6EI696LAAfMgK41P5VYsItPF2hwmuv2QIjUBTDzJs3kIikFXb7oKAkUT bKO+15lj2j9HAs32nhlNa/1act1GIzLltavT2R+I3NZPdpSqhhsejzgNI3Y0MO7W6OqjS8g0XgL ie+9v8ZFCc+iYldbAr9NU23qtXfPrPqYZ//qxaH+e95v7nceeg+Y2yJVqKbAdmwcR3G993SEgR1 wVDzxFTmBPqgfr7O6NPWlt6jbym7bsyuNRqIfrmHlrkbIpExb43BRgFsml87IidqABNXyg+hjuU OXB/wKsaGrlMvhBKm+YvsB+RNk7gjUh8omE3qdHzcZaP0NrOR60KcwoqfJXe/yCiy9UVLl986YE UKTdGiysgK7b4roItxEEUMXAUFCq8WXx0wCA2W/NtRZn7jzjheFCUvlF4KiaW4J8w3g+NM4Q2xM RjDU/3hrnnuurzh7GHDvtTp/5vtiBMbwi0K1Y2kwDzaSlWj2vUikRRTycKU+bmh+z17+INnUdCI KvDKoJK 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: sched-ext@lists.linux.dev 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