From: linuxtestproject.agent@gmail.com
To: Samir Mulani <samir@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] cgroup: Add cgroup_burst01 test
Date: Tue, 29 Sep 2026 07:14:32 +0000 [thread overview]
Message-ID: <20260929071432.9277-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260928051740.591819-2-samir@linux.ibm.com>
Hi Samir,
On Mon, 28 Sep 2026 07:17:34 +0200, Samir Mulani wrote:
> cgroup: Add cgroup_burst01 test
--- [PATCH 1/2] ---
> cgroup: Add cgroup_burst01 test
The test and binary name is cpu_max_burst01. Update the subject line
to match the test name.
> TC3 - A worker underruns to build up burst credit, then overloads
> to consume it; cpu.stat nr_bursts and burst_usec counters
> must increase. Also checks that burst can be updated while
> tasks are running.
The test code never updates cpu.max.burst while tasks are running.
Update the commit message or add the missing check to the test.
> diff --git a/runtest/controllers b/runtest/controllers
> --- a/runtest/controllers
> +++ b/runtest/controllers
> @@ -3,6 +3,7 @@ cgroup_core01 cgroup_core01
> cgroup_core02 cgroup_core02
> cgroup_core03 cgroup_core03
> cgroup cgroup_regression_test.sh
> +cpu_max_burst01 cpu_max_burst01
Use a tab character instead of spaces between the test name and the
binary path.
> * Test scenarios:
> * TC 1 - Default value and write-zero: cpu.max.burst defaults to 0;
Insert a blank line before the list in the documentation comment block.
> if (err != EINVAL) {
> tst_res(TWARN,
> "tc2_burst_exceeds_quota: got errno=%d (%s), expected EINVAL",
> err, tst_strerrno(err));
> }
>
> if (burst != BURST_US) {
> tst_res(TFAIL,
> "tc2_burst_exceeds_quota: burst corrupted after rejected write (expected %llu us, got %llu us)",
> BURST_US, burst);
> } else {
> tst_res(TPASS,
> "tc2_burst_exceeds_quota: burst=%llu rejected (errno=%d), stored value unchanged (%llu us)",
> bad_burst, err, burst);
> }
If err != EINVAL, report TFAIL instead of TWARN. As written, receiving an
unexpected errno still reports TPASS when burst remains unchanged.
> read_burst_stat(cg_child, &after);
Check the return value of read_burst_stat(). If reading cpu.stat fails,
abort with TBROK rather than proceeding with zeroed stats to TFAIL.
> if (cmd_pipe[1] >= 0) {
> SAFE_CLOSE(cmd_pipe[1]);
> cmd_pipe[1] = -1;
> }
> if (ack_pipe[0] >= 0) {
> SAFE_CLOSE(ack_pipe[0]);
> ack_pipe[0] = -1;
> }
Use '!= -1' instead of '>= 0' to check file descriptor validity.
--- [PATCH 2/2] ---
> cgroup: Add invalid burst test
Name the test explicitly in the subject line (e.g. cgroup: Add
cpu_max_burst_invalid01 test).
> diff --git a/runtest/controllers b/runtest/controllers
> --- a/runtest/controllers
> +++ b/runtest/controllers
> @@ -4,6 +4,7 @@ cgroup_core02 cgroup_core02
> cgroup_core03 cgroup_core03
> cgroup cgroup_regression_test.sh
> cpu_max_burst01 cpu_max_burst01
> +cpu_max_burst_invalid01 cpu_max_burst_invalid01
Use a tab character instead of spaces between the test name and the
binary path.
> * Test scenarios:
> * TC 1 - Boundary and sign violations: burst = quota+1 (B) and burst = "-1"
Insert a blank line before the list in the documentation comment block.
> /* MAX_BW_US: kernel max_bw_runtime_us = (1 << BW_SHIFT) * USEC_PER_SEC */
> #define MAX_BW_US (((uint64_t)1 << 20) * 1000000ULL)
The kernel defines MAX_BW as ((1ULL << (64 - BW_SHIFT)) - 1), which is
(1ULL << 44) - 1. The current calculation is too small and does not exceed
the kernel limit, causing tc2 to always take the TCONF fallback path.
> static int cg_write_str(const struct tst_cg_group *cg,
> const char *fname, const char *str)
> {
> int fd, saved = 0;
> ssize_t n;
>
> fd = SAFE_OPENAT(cg_dirfd(cg), fname, O_WRONLY);
> n = write(fd, str, strlen(str));
Use TST_EXP_FAIL2(write(...), EINVAL) rather than calling bare write()
and propagating errno through helper return values.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-09-29 7:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 5:17 [LTP] [PATCH 0/2] cgroup: Add tests for cgroupv2 cpu.max.burst Samir Mulani
2026-09-28 5:17 ` [LTP] [PATCH 1/2] cgroup: Add cgroup_burst01 test Samir Mulani
2026-09-29 7:14 ` linuxtestproject.agent [this message]
2026-09-28 5:17 ` [LTP] [PATCH 2/2] cgroup: Add invalid burst test Samir Mulani
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=20260929071432.9277-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=samir@linux.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.