From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Mel Gorman <mgorman@suse.de>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Rik van Riel <riel@surriel.com>
Subject: Re: [RFC PATCH 2/2] NUMA balancing: avoid to migrate task to CPU-less node
Date: Tue, 1 Feb 2022 11:29:04 +0530 [thread overview]
Message-ID: <20220201055904.GD618915@linux.vnet.ibm.com> (raw)
In-Reply-To: <877dakti0n.fsf@yhuang6-desk2.ccr.corp.intel.com>
* Huang, Ying <ying.huang@intel.com> [2022-01-28 15:51:36]:
> Srikar Dronamraju <srikar@linux.vnet.ibm.com> writes:
>
> > * Huang Ying <ying.huang@intel.com> [2022-01-28 10:38:42]:
> >
> This sounds reasonable. How about the following solution? If a
> CPU-less node is selected as migration target, we select a nearest node
> with CPU instead? That is, something like the below patch.
>
> Best Regards,
> Huang, Ying
>
> ------------------------------8<---------------------------------
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5146163bfabb..52d926d8cbdb 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2401,6 +2401,23 @@ static void task_numa_placement(struct task_struct *p)
> }
> }
>
> + /* Cannot migrate task to CPU-less node */
> + if (!node_state(max_nid, N_CPU)) {
> + int near_nid = max_nid;
> + int distance, near_distance = INT_MAX;
> +
> + for_each_online_node(nid) {
> + if (!node_state(nid, N_CPU))
> + continue;
> + distance = node_distance(max_nid, nid);
> + if (distance < near_distance) {
> + near_nid = nid;
> + near_distance = distance;
> + }
> + }
> + max_nid = near_nid;
> + }
> +
This looks good. but should we move this into preferred_group_nid()?
i.e should we care for !ng case, since those would mean only private faults.
> if (ng) {
> numa_group_count_active_nodes(ng);
> spin_unlock_irq(group_lock);
--
Thanks and Regards
Srikar Dronamraju
next prev parent reply other threads:[~2022-02-01 6:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 2:38 [RFC PATCH 1/2] NUMA balancing: fix NUMA topology type for memory tiering system Huang Ying
2022-01-28 2:38 ` [RFC PATCH 2/2] NUMA balancing: avoid to migrate task to CPU-less node Huang Ying
2022-01-28 5:33 ` Srikar Dronamraju
2022-01-28 7:51 ` Huang, Ying
2022-02-01 5:59 ` Srikar Dronamraju [this message]
2022-02-08 8:19 ` Huang, Ying
2022-01-28 5:23 ` [RFC PATCH 1/2] NUMA balancing: fix NUMA topology type for memory tiering system Srikar Dronamraju
2022-01-28 7:30 ` Huang, Ying
2022-01-28 15:13 ` Peter Zijlstra
2022-01-30 1:07 ` Huang, Ying
2022-01-28 15:06 ` Peter Zijlstra
2022-01-28 17:08 ` Valentin Schneider
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=20220201055904.GD618915@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=ying.huang@intel.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.