From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-24.mta1.migadu.com [95.215.58.24]) (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 D28CE3A3E76 for ; Thu, 20 Aug 2026 07:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787209803; cv=none; b=bTo1eyjVpFlTf2mC1QBO0S/U0Bh3r9T0YYc/9BS6ri1oFB/KbhNj1cM9WRh8cEOkHk6MkasclybNIhWat6Sk3MP6nbpWQQ/EZt0VjHXm1iNzyF42GMBgUntjsPvMMtsYzDeMRj5v6pfmw+1Y9SZzMcoh/aKwCU9o+hHSpmIamNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787209803; c=relaxed/simple; bh=2+3QA95E2Qu2z4Bb6C3P8E4Hs/HGV5s2I/yaYEntkPM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gCHPwBQjGYGDocKQL3xN3Gyjt/IL8QMeA+Jkv+7FfW2DZd9Ky1DCKiHJwFCrDNtg2wYGyMEjm0wjPYnlq/f9nmVM4ZJGctW9MLrVYGXXQGY6yJfXEB/MF/8DQI1MwX0Fe2Yh2gwFgSAAqD18eileXiZZE+Ds9NNhjsIHjlVpvVk= 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=WukPQs3d; arc=none smtp.client-ip=95.215.58.24 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="WukPQs3d" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=2+3QA95E2Qu2z4Bb6C3P8E4Hs/HGV5s2I/yaYEntkPM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787209798; v=1; x=1787814598; b=WukPQs3dVMwGlFweLhdN9fsVgvqubuiGnVCvVU+MF0F0EszPIn7C8+00sDn5j+LRCuukhSZt NQwims0sZg2KXnPfaWmjOug+MDAk+V+KYdu5+PVDSGWpFFMsJCdAMKGp5ZJobco5Pz+jj83Hs+o lzx7D7h23P36uKx9E9ACJp/0= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost.localdomain (223.70.159.239) by smtp.migadu.com with ESMTPS id f83ced2c4d3f1100; Thu, 20 Aug 2026 07:09:58 +0000 X-Mizu-Trace-ID: f83ced2c4d3f1100 X-Migadu-Flow: FLOW_OUT From: Hongfu Li To: hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, tj@kernel.org, mkoutny@suse.com, shuah@kernel.org, akpm@linux-foundation.org Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, hongfu.li@linux.dev, Hongfu Li Subject: [PATCH] selftests/cgroup: Fix cg_run_in_subcgroups ignoring arg parameter Date: Thu, 20 Aug 2026 15:09:44 +0800 Message-ID: <20260820070944.31451-1-hongfu.li@linux.dev> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Hongfu Li cg_run_in_subcgroups() discards its arg and always passes NULL to cg_run(), turning the (void *)100 from test_kmem_dead_cgroups() into NULL so no allocation occurs. This makes test_kmem_dead_cgroups() falsely pass without exercising the "dying cgroup with charged slab" scenario it intends to test. Pass the arg through to cg_run() to fix this. Fixes: 933dc80ec262 ("kselftests: cgroup: add kernel memory accounting tests") Signed-off-by: Hongfu Li --- tools/testing/selftests/cgroup/test_kmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c index 1db0ba1226b9..98e9f9f45ab9 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -145,7 +145,7 @@ static int cg_run_in_subcgroups(const char *parent, return -1; } - if (cg_run(child, fn, NULL)) { + if (cg_run(child, fn, arg)) { cg_destroy(child); free(child); return -1; -- 2.54.0