Linux cgroups development
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Shaojie Sun <sunshaojie@kylinos.cn>
Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org,
	 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	shuah@kernel.org, tj@kernel.org
Subject: Re: [PATCH v2] selftests/cgroup: add user_usec sanity check in test_cpucg_nice
Date: Fri, 31 Jul 2026 11:18:37 +0200	[thread overview]
Message-ID: <amxoWCgc94e9E6kb@localhost.localdomain> (raw)
In-Reply-To: <20260730130717.1236233-1-sunshaojie@kylinos.cn>

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

On Thu, Jul 30, 2026 at 09:07:17PM +0800, Shaojie Sun <sunshaojie@kylinos.cn> wrote:
> In test_cpucg_nice, after the child process exits, user_usec is
> read from cpu.stat but the value is not checked. Add a sanity check
> to ensure user_usec > 0, analogous to test_cpucg_stats(), so that
> the test fails early if CPU usage wasn't properly accounted.
> 
> Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
> ---
> v2: Instead of simply removing the unused user_usec read, add a sanity
>     check (if user_usec <= 0, goto cleanup) analogous to test_cpucg_stats(),
>     as suggested by Michal.
> 
>  tools/testing/selftests/cgroup/test_cpu.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Michal Koutný <mkoutny@suse.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

  parent reply	other threads:[~2026-07-31  9:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 10:04 [PATCH 0/2] selftests/cgroup: misc cleanups for test_cpu.c Shaojie Sun
2026-07-29 10:04 ` [PATCH 1/2] selftests/cgroup: remove unused user_usec read in test_cpucg_nice Shaojie Sun
2026-07-29 11:58   ` Michal Koutný
2026-07-30 13:07     ` [PATCH v2] selftests/cgroup: add user_usec sanity check " Shaojie Sun
2026-07-30 14:55       ` Tao Cui
2026-07-31  9:18       ` Michal Koutný [this message]
2026-07-29 10:04 ` [PATCH 2/2] selftests/cgroup: write explicit period to cpu.max in max tests Shaojie Sun
2026-07-29 11:53   ` Michal Koutný

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amxoWCgc94e9E6kb@localhost.localdomain \
    --to=mkoutny@suse.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=sunshaojie@kylinos.cn \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox