Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp814922ybz; Fri, 1 May 2020 09:02:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLltsBq8wzdtGz/D9U1lMQwFSg796d5xbTAmVWlwLTlM++aHTfcx8cd93itdpMb5YXiJ/8F X-Received: by 2002:a17:906:2993:: with SMTP id x19mr4031931eje.280.1588348952275; Fri, 01 May 2020 09:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588348952; cv=none; d=google.com; s=arc-20160816; b=EhYmNoNeUy51D5j2nzXTvWxAyf7FgCWMa3PpJmWWh0qAceyXy59qOwzyD/X/mqPCdt PzY46YBJh91FjQfFauJJSt0GkurVkVycTTRPeAU3eF06z21sPQuwMG6v4n/MWU7cUWzG 41Zc7gxXWKKotbRIY6fHKfrp74pFXRCq39/EyJ57YpFZcsYppKECQN8/7oWyWtBsRnuu Y7jguG0AF6iJ+CguYBbRJ4Qo6tx+wrezxGf2w2amKHhH6r3FoB7G2MBp8wIidvqEURu/ ENt5H7BfLHQEQ4k4C/x0S35DSyViqS/01hJiqzkDoBMIShSuEVhGO063RJI3a5YlVNJI Wlhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=iSaDmF3QcIFwU8m2sq9flV39t0hPYUFm9HCsa6qegDs=; b=x9uRjBiOX9O3/hAYRSPq9EJePM2Yn4A/uRd4cJOWef1tN+JYKC/ZLBdXvardp3i92D lRh9nhYjkYrUGR2hJOB2TqYU96ocuDrukzFgeGd2+6kN/Xdhv8BuLHDmIm8CH8qfLWvB rVCLLw59fUOwgpbPmgFdDb0n4RLAyFgZSL6r/xNOr7GkRGmf5Ovny4EgZlvQpTjOEh4s uEyfFaU3tfKAmhE/CXePg+MDy3Zkh2MROPs0/uw1Qb76dl7RttJElN9zPHnCxlh/7HJj rQaYE3h4MhgsCua79pAfBeii7ZRb/9QBUjqhjd5T2x4PG6ydvPzmE/iD/LNF2Y5Um2oB KpOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pv20si2026770ejb.295.2020.05.01.09.02.06; Fri, 01 May 2020 09:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729981AbgEAQBz (ORCPT + 99 others); Fri, 1 May 2020 12:01:55 -0400 Received: from fieldses.org ([173.255.197.46]:40336 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729625AbgEAQBy (ORCPT ); Fri, 1 May 2020 12:01:54 -0400 Received: by fieldses.org (Postfix, from userid 2815) id E6D1E4F42; Fri, 1 May 2020 12:01:53 -0400 (EDT) From: "J. Bruce Fields" To: Linus Torvalds Cc: linux-nfs@vger.kernel.org, Jeff Layton , David Howells , Tejun Heo , Shaohua Li , Oleg Nesterov , linux-kernel@vger.kernel.org, "J. Bruce Fields" Subject: [PATCH 2/4] kthreads: Simplify tsk_fork_get_node Date: Fri, 1 May 2020 12:01:50 -0400 Message-Id: <1588348912-24781-3-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1588348912-24781-1-git-send-email-bfields@redhat.com> References: <1588348912-24781-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" This will also simplify a following patch that allows multiple kthreadd's. Signed-off-by: J. Bruce Fields --- 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