All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: Li Zhe <lizhe.67@bytedance.com>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
	<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
	<dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
	<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
	<kprateek.nayak@amd.com>, <linux-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <linux-doc@vger.kernel.org>
Subject: Re: [PATCH 1/4] sched/numa: Track per-process automatic NUMA balancing mode
Date: Tue, 13 Oct 2026 17:54:49 +0800	[thread overview]
Message-ID: <as3_6bNoAMkf61uw@chenyu-dev> (raw)
In-Reply-To: <20260908122446.56708-2-lizhe.67@bytedance.com>

On Tue, Sep 08, 2026 at 08:24:43PM +0800, Li Zhe wrote:

[ snip ]

> +int task_numa_balancing_set_current(bool enabled)
> +{
> +	static DEFINE_MUTEX(task_numa_balancing_mutex);
> +	struct task_struct *t;
> +	unsigned long flags;
> +	bool old_enabled;
> +
> +	guard(mutex)(&task_numa_balancing_mutex);
> +
> +	if (WARN_ON_ONCE(!lock_task_sighand(current, &flags)))
> +		return -ESRCH;
> +
> +	old_enabled = current->signal->numa_balancing_enabled;
> +	if (old_enabled != enabled)
> +		WRITE_ONCE(current->signal->numa_balancing_enabled, enabled);
> +
> +	unlock_task_sighand(current, &flags);
> +
> +	if (old_enabled != enabled) {
> +		sched_numa_balancing_change_task(current, enabled);
> +		read_lock(&tasklist_lock);

I wonder if we can use the RCU read lock instead to avoid being blocked by
/blocking the fork && exec, which grabs the write lock of tasklock_lock.
Agents do frequent fork/exec, so we may want to avoid interfering with them?

thanks,
Chenyu

  reply	other threads:[~2026-10-13 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 12:24 [PATCH 0/4] sched/numa: Add per-process automatic NUMA balancing control Li Zhe
2026-09-08 12:24 ` [PATCH 1/4] sched/numa: Track per-process automatic NUMA balancing mode Li Zhe
2026-10-13  9:54   ` Chen Yu [this message]
2026-09-08 12:24 ` [PATCH 2/4] sched/numa: Add prctl controls for process mode Li Zhe
2026-09-08 12:24 ` [PATCH 3/4] proc: Report process NUMA balancing mode Li Zhe
2026-09-08 12:24 ` [PATCH 4/4] Documentation: Describe per-process NUMA balancing control Li Zhe
2026-10-13  7:39 ` [PATCH 0/4] sched/numa: Add per-process automatic " Chen Yu
2026-10-13  9:31   ` Yafang Shao

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=as3_6bNoAMkf61uw@chenyu-dev \
    --to=yu.c.chen@intel.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhe.67@bytedance.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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.