mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Xiu Jianfeng <xiujianfeng@huaweicloud.com>
Cc: lizefan.x@bytedance.com, hannes@cmpxchg.org, mkoutny@suse.com,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	xiujianfeng@huawei.com
Subject: Re: [PATCH v2 -next] cgroup/pids: Avoid spurious event notification
Date: Tue, 30 Jul 2024 12:14:46 -1000	[thread overview]
Message-ID: <Zqll1sNJB4qQc0s2@slm.duckdns.org> (raw)
In-Reply-To: <20240730032920.3690263-1-xiujianfeng@huaweicloud.com>

On Tue, Jul 30, 2024 at 03:29:20AM +0000, Xiu Jianfeng wrote:
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
> 
> Currently when a process in a group forks and fails due to it's
> parent's max restriction, all the cgroups from 'pids_forking' to root
> will generate event notifications but only the cgroups from
> 'pids_over_limit' to root will increase the counter of PIDCG_MAX.
> 
> Consider this scenario: there are 4 groups A, B, C,and D, the
> relationships are as follows, and user is watching on C.pids.events.
> 
> root->A->B->C->D
> 
> When a process in D forks and fails due to B.max restriction, the
> user will get a spurious event notification because when he wakes up
> and reads C.pids.events, he will find that the content has not changed.
> 
> To address this issue, only the cgroups from 'pids_over_limit' to root
> will have their PIDCG_MAX counters increased and event notifications
> generated.
> 
> Fixes: 385a635cacfe ("cgroup/pids: Make event counters hierarchical")
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

Applied to cgroup/for-6.12.

Note that spurious events are explicitly allowed. Anyone watching an events
file should keep track of the reported values to detect actual events.

Thanks.

-- 
tejun

  reply	other threads:[~2024-07-30 22:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30  3:29 Xiu Jianfeng
2024-07-30 22:14 ` Tejun Heo [this message]
2024-07-31  2:56   ` Xiu Jianfeng

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=Zqll1sNJB4qQc0s2@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mkoutny@suse.com \
    --cc=xiujianfeng@huawei.com \
    --cc=xiujianfeng@huaweicloud.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®