From: Waiman Long <llong@redhat.com>
To: Jin Guojie <guojie.jin@gmail.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Michal Koutný" <mkoutny@suse.com>
Subject: Re: [PATCH] [PATCH v4] cgroup/cpuset: fmeter_getrate() returns 0 when memory_pressure disabled
Date: Mon, 17 Feb 2025 20:37:12 -0500 [thread overview]
Message-ID: <bc7241fb-2349-48aa-8d77-dca76490673a@redhat.com> (raw)
In-Reply-To: <20250218010316.1950017-1-guojie.jin@gmail.com>
On 2/17/25 8:03 PM, Jin Guojie wrote:
> When running LTP's cpuset_memory_pressure program, an error can be
> reproduced by the following steps:
>
> (1) Create a cgroup, enable cpuset subsystem, set memory limit, and
> then set cpuset_memory_pressure to 1
> (2) In this cgroup, create a process to allocate a large amount of
> memory and generate pressure counts
> (3) Set cpuset_memory_pressure to 0
> (4) Check cpuset.memory_pressure: LTP thinks it should be 0, but the
> kernel returns a value of 1, so LTP determines it as FAIL
>
> This patch modifies fmeter_getrate() to determine whether to return 0
> based on cpuset_memory_pressure_enabled.
>
> Signed-off-by: Jin Guojie <guojie.jin@gmail.com>
> Acked-by: Michal Koutný <mkoutny@suse.com>
> Acked-by: Waiman Long <longman@redhat.com>
> ---
> kernel/cgroup/cpuset-v1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index 25c1d7b77e2f..14564e91e2b3 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -108,7 +108,7 @@ static int fmeter_getrate(struct fmeter *fmp)
> fmeter_update(fmp);
> val = fmp->val;
> spin_unlock(&fmp->lock);
> - return val;
> + return cpuset_memory_pressure_enabled ? val : 0;
> }
>
> /*
Acked-by: Waiman Long <longman@redhat.com>
prev parent reply other threads:[~2025-02-18 1:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 1:03 Jin Guojie
2025-02-18 1:37 ` Waiman Long [this message]
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=bc7241fb-2349-48aa-8d77-dca76490673a@redhat.com \
--to=llong@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=guojie.jin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®