All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: JP Kobryn <inwardvessel@gmail.com>
Cc: tj@kernel.org, shakeel.butt@linux.dev, mkoutny@suse.com,
	hannes@cmpxchg.org, akpm@linux-foundation.org,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH v5 1/5] cgroup: use helper for distingushing css in callbacks
Date: Wed, 7 May 2025 09:02:52 +0000	[thread overview]
Message-ID: <aBshvNRl6fCGKVmS@google.com> (raw)
In-Reply-To: <20250503001222.146355-2-inwardvessel@gmail.com>

On Fri, May 02, 2025 at 05:12:18PM -0700, JP Kobryn wrote:
> The callbacks used for cleaning up css's check whether the css is
> associated with a subsystem or not. Instead of just checking the ss
> pointer, use the helper functions to better show the intention.
> 
> Signed-off-by: JP Kobryn <inwardvessel@gmail.com>

I still think this should be renamed and potentially reimplemented to
(also?) check css->cgroup->self, but anyway:

Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>

> ---
>  kernel/cgroup/cgroup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 7471811a00de..125240f8318c 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -5406,7 +5406,7 @@ static void css_free_rwork_fn(struct work_struct *work)
>  
>  	percpu_ref_exit(&css->refcnt);
>  
> -	if (ss) {
> +	if (!css_is_cgroup(css)) {
>  		/* css free path */
>  		struct cgroup_subsys_state *parent = css->parent;
>  		int id = css->id;
> @@ -5460,7 +5460,7 @@ static void css_release_work_fn(struct work_struct *work)
>  	css->flags |= CSS_RELEASED;
>  	list_del_rcu(&css->sibling);
>  
> -	if (ss) {
> +	if (!css_is_cgroup(css)) {
>  		struct cgroup *parent_cgrp;
>  
>  		/* css release path */
> -- 
> 2.47.1
> 
> 

  parent reply	other threads:[~2025-05-07  9:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-03  0:12 [PATCH v5 0/5] cgroup: separate rstat trees JP Kobryn
2025-05-03  0:12 ` [PATCH v5 1/5] cgroup: use helper for distingushing css in callbacks JP Kobryn
2025-05-06  0:52   ` Shakeel Butt
2025-05-07  9:02   ` Yosry Ahmed [this message]
2025-05-09 21:46     ` JP Kobryn
2025-05-03  0:12 ` [PATCH v5 2/5] cgroup: use separate rstat trees for each subsystem JP Kobryn
2025-05-07  9:24   ` Yosry Ahmed
2025-05-09 17:53     ` JP Kobryn
2025-05-12 17:30     ` JP Kobryn
2025-05-03  0:12 ` [PATCH v5 3/5] cgroup: use subsystem-specific rstat locks to avoid contention JP Kobryn
2025-05-07  9:37   ` Yosry Ahmed
2025-05-03  0:12 ` [PATCH v5 4/5] cgroup: helper for checking rstat participation of css JP Kobryn
2025-05-07  9:38   ` Yosry Ahmed
2025-05-03  0:12 ` [PATCH v5 5/5] cgroup: document the rstat per-cpu initialization JP Kobryn

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=aBshvNRl6fCGKVmS@google.com \
    --to=yosry.ahmed@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=inwardvessel@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=linux-mm@kvack.org \
    --cc=mkoutny@suse.com \
    --cc=shakeel.butt@linux.dev \
    --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 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.