mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: Chuyi Zhou <zhouchuyi@bytedance.com>,
	tj@kernel.org, mkoutny@suse.com, hannes@cmpxchg.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] cgroup: Remove unused cgroup_subsys::post_attach
Date: Thu, 4 Sep 2025 11:17:12 -0400	[thread overview]
Message-ID: <f7b5caf9-ab30-4b51-b3c0-9e3cdfdc2b2a@redhat.com> (raw)
In-Reply-To: <20250904074505.1722678-4-zhouchuyi@bytedance.com>

On 9/4/25 3:45 AM, Chuyi Zhou wrote:
> cgroup_subsys::post_attach callback was introduced in commit 5cf1cacb49ae
> ("cgroup, cpuset: replace cpuset_post_attach_flush() with
> cgroup_subsys->post_attach callback") and only cpuset would use this
> callback to wait for the mm migration to complete at the end of
> __cgroup_procs_write(). Since the previous patch defer the flush operation
> until returning to userspace, no one use this callback now. Remove this
> callback from cgroup_subsys.
>
> Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
> ---
>   include/linux/cgroup-defs.h | 1 -
>   kernel/cgroup/cgroup.c      | 4 ----
>   2 files changed, 5 deletions(-)
>
> diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
> index 6b93a64115fe9..432abdfdb2593 100644
> --- a/include/linux/cgroup-defs.h
> +++ b/include/linux/cgroup-defs.h
> @@ -746,7 +746,6 @@ struct cgroup_subsys {
>   	int (*can_attach)(struct cgroup_taskset *tset);
>   	void (*cancel_attach)(struct cgroup_taskset *tset);
>   	void (*attach)(struct cgroup_taskset *tset);
> -	void (*post_attach)(void);
>   	int (*can_fork)(struct task_struct *task,
>   			struct css_set *cset);
>   	void (*cancel_fork)(struct task_struct *task, struct css_set *cset);
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 312c6a8b55bb7..75819bb2f1148 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -3033,10 +3033,6 @@ void cgroup_procs_write_finish(struct task_struct *task, bool threadgroup_locked
>   	put_task_struct(task);
>   
>   	cgroup_attach_unlock(threadgroup_locked);
> -
> -	for_each_subsys(ss, ssid)
> -		if (ss->post_attach)
> -			ss->post_attach();
>   }
>   
>   static void cgroup_print_ss_mask(struct seq_file *seq, u16 ss_mask)

Note that we may have to add it back in the future if a new use case 
comes up.

Acked-by:  Waiman Long <longman@redhat.com>


  reply	other threads:[~2025-09-04 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  7:45 [PATCH 0/3] Defer flushing of the cpuset_migrate_mm_wq to task_work Chuyi Zhou
2025-09-04  7:45 ` [PATCH 1/3] cpuset: Don't always flush cpuset_migrate_mm_wq in cpuset_write_resmask Chuyi Zhou
2025-09-04 14:30   ` Michal Koutný
2025-09-04 15:12   ` Waiman Long
2025-09-04 17:15   ` Tejun Heo
2025-09-04  7:45 ` [PATCH 2/3] cpuset: Defer flushing of the cpuset_migrate_mm_wq to task_work Chuyi Zhou
2025-09-04 15:14   ` Waiman Long
2025-09-04  7:45 ` [PATCH 3/3] cgroup: Remove unused cgroup_subsys::post_attach Chuyi Zhou
2025-09-04 15:17   ` Waiman Long [this message]
2025-09-04 17:27 ` [PATCH 0/3] Defer flushing of the cpuset_migrate_mm_wq to task_work Tejun Heo
2025-09-05  2:15   ` Chuyi Zhou

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=f7b5caf9-ab30-4b51-b3c0-9e3cdfdc2b2a@redhat.com \
    --to=llong@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=tj@kernel.org \
    --cc=zhouchuyi@bytedance.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®