From: Xuewen Yan <xuewen.yan@unisoc.com>
To: <mingo@redhat.com>, <peterz@infradead.org>,
<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
<longman@redhat.com>
Cc: <dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
<linux-kernel@vger.kernel.org>, <ke.wang@unisoc.com>,
<di.shen@unisoc.com>, <xuewen.yan94@gmail.com>
Subject: [RFC PATCH] sched: Do not copy user_cpus_ptr when parent is reset_on_fork
Date: Thu, 5 Sep 2024 17:04:58 +0800 [thread overview]
Message-ID: <20240905090458.1173-1-xuewen.yan@unisoc.com> (raw)
Now, the task's user_cpus_ptr would dup from parent's user_cpus_ptr.
It is better reset the user_cpus_ptr when parent's reset_on_fork
is set.
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f3951e4a55e5..2fbae00cd1dc 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2666,7 +2666,7 @@ int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src,
* do_set_cpus_allowed().
*/
raw_spin_lock_irqsave(&src->pi_lock, flags);
- if (src->user_cpus_ptr) {
+ if (src->user_cpus_ptr && !src->sched_reset_on_fork) {
swap(dst->user_cpus_ptr, user_mask);
cpumask_copy(dst->user_cpus_ptr, src->user_cpus_ptr);
}
--
2.25.1
next reply other threads:[~2024-09-05 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 9:04 Xuewen Yan [this message]
2024-09-05 12:42 ` Waiman Long
2024-09-05 13:12 ` Phil Auld
2024-09-05 14:00 ` Waiman Long
2024-09-05 14:09 ` Phil Auld
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=20240905090458.1173-1-xuewen.yan@unisoc.com \
--to=xuewen.yan@unisoc.com \
--cc=bsegall@google.com \
--cc=di.shen@unisoc.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=ke.wang@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.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 \
--cc=xuewen.yan94@gmail.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®