From: "J. Bruce Fields" <bfields@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-nfs@vger.kernel.org, Jeff Layton <jlayton@redhat.com>,
David Howells <dhowells@redhat.com>, Tejun Heo <tj@kernel.org>,
Shaohua Li <shli@fb.com>, Oleg Nesterov <oleg@redhat.com>,
linux-kernel@vger.kernel.org,
"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 2/4] kthreads: Simplify tsk_fork_get_node
Date: Fri, 1 May 2020 12:01:50 -0400 [thread overview]
Message-ID: <1588348912-24781-3-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1588348912-24781-1-git-send-email-bfields@redhat.com>
From: "J. Bruce Fields" <bfields@redhat.com>
This will also simplify a following patch that allows multiple
kthreadd's.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
init/init_task.c | 3 +++
kernel/fork.c | 4 ++++
kernel/kthread.c | 3 +--
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/init/init_task.c b/init/init_task.c
index bd403ed3e418..fdd760393760 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -154,6 +154,9 @@ struct task_struct init_task
.vtime.starttime = 0,
.vtime.state = VTIME_SYS,
#endif
+#ifdef CONFIG_NUMA
+ .pref_node_fork = NUMA_NO_NODE,
+#endif
#ifdef CONFIG_NUMA_BALANCING
.numa_preferred_nid = NUMA_NO_NODE,
.numa_group = NULL,
diff --git a/kernel/fork.c b/kernel/fork.c
index 8c700f881d92..fa35890534d5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -942,6 +942,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
tsk->fail_nth = 0;
#endif
+#ifdef CONFIG_NUMA
+ tsk->pref_node_fork = NUMA_NO_NODE;
+#endif
+
#ifdef CONFIG_BLK_CGROUP
tsk->throttle_queue = NULL;
tsk->use_memdelay = 0;
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 4217fded891a..483bee57a9c8 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -274,8 +274,7 @@ static int kthread(void *_create)
int tsk_fork_get_node(struct task_struct *tsk)
{
#ifdef CONFIG_NUMA
- if (tsk == kthreadd_task)
- return tsk->pref_node_fork;
+ return tsk->pref_node_fork;
#endif
return NUMA_NO_NODE;
}
--
2.26.2
next prev parent reply other threads:[~2020-05-01 16:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 16:01 [PATCH 0/4] allow multiple kthreadd's J. Bruce Fields
2020-05-01 16:01 ` [PATCH 1/4] kthreads: minor kthreadd refactoring J. Bruce Fields
2020-05-01 16:01 ` J. Bruce Fields [this message]
2020-05-01 16:01 ` [PATCH 3/4] kthreads: allow multiple kthreadd's J. Bruce Fields
2020-05-01 16:01 ` [PATCH 4/4] kthreads: allow cloning threads with different flags J. Bruce Fields
2020-05-01 17:59 ` [PATCH 0/4] allow multiple kthreadd's Linus Torvalds
2020-05-01 18:21 ` Tejun Heo
2020-05-01 18:30 ` Linus Torvalds
2020-05-01 19:02 ` J. Bruce Fields
2020-05-01 18:49 ` J. Bruce Fields
2020-05-01 19:05 ` Trond Myklebust
2020-05-01 19:20 ` tj
2020-05-01 19:22 ` J. Bruce Fields
2020-05-05 2:15 ` J. Bruce Fields
2020-05-05 15:54 ` Tejun Heo
2020-05-05 16:23 ` J. Bruce Fields
2020-05-05 21:01 ` J. Bruce Fields
2020-05-05 21:09 ` Tejun Heo
2020-05-05 21:25 ` J. Bruce Fields
2020-05-06 15:36 ` J. Bruce Fields
2020-05-06 15:39 ` Tejun Heo
2020-05-06 15:54 ` J. Bruce Fields
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=1588348912-24781-3-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=dhowells@redhat.com \
--cc=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=shli@fb.com \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.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.