mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: peterz@infradead.org, aubrey.li@linux.intel.com, efault@gmx.de,
	gautham.shenoy@amd.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, song.bao.hua@hisilicon.com,
	srikar@linux.vnet.ibm.com, valentin.schneider@arm.com,
	vincent.guittot@linaro.org
Subject: Re: [PATCH v4] sched/fair: Consider cpu affinity when allowing NUMA imbalance in find_idlest_group
Date: Thu, 17 Feb 2022 16:53:51 +0530	[thread overview]
Message-ID: <a57dbac2-1b8e-ea5c-8b6c-3a97ac186ad9@amd.com> (raw)
In-Reply-To: <20220217100523.GV3366@techsingularity.net>

Hello Mel,


Thank you for looking into the patch.

On 2/17/2022 3:35 PM, Mel Gorman wrote:
> Thanks Prateek,
>
> On Thu, Feb 17, 2022 at 11:24:08AM +0530, K Prateek Nayak wrote:
>> [..snip..]
>>
>> Eg: numactl -C 0,16,32,48,64,80,96,112 ./stream8
>>
> In this case the stream threads can use any CPU of the subset, presumably
> this is parallelised with OpenMP without specifying spread or bind
> directives.
Yes it is parallelized using OpenMP without specifying any directive.
> [..snip..]
> One concern I have is that we incur a cpumask setup and cpumask_weight
> cost on every clone whether a restricted CPU mask is used or not.  Peter,
> is it acceptable to avoid the cpumask check if there is no restrictions
> on allowed cpus like this?
>
> 	imb = sd->imb_numa_nr;
> 	if (p->nr_cpus_allowed != num_online_cpus())
> 		struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
>
> 		cpumask_and(cpus, sched_group_span(local), p->cpus_ptr);
> 		imb = min(cpumask_weight(cpus), imb);
> 	}
Can we optimize this further as:

	imb = sd->imb_numa_nr;
	if (unlikely(p->nr_cpus_allowed != num_online_cpus()))
		struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);

		cpumask_and(cpus, sched_group_span(local), p->cpus_ptr);
		imb = min(cpumask_weight(cpus), imb);
	}

As for most part, p->nr_cpus_allowed will be equal to num_online_cpus()
unless user has specifically pinned the task.

--
Thanks and Regards,
Prateek


  reply	other threads:[~2022-02-17 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17  5:54 K Prateek Nayak
2022-02-17 10:05 ` Mel Gorman
2022-02-17 11:23   ` K Prateek Nayak [this message]
2022-02-17 13:15     ` Mel Gorman
2022-02-18  3:55       ` K Prateek Nayak
2022-02-22  6:00       ` K Prateek Nayak
2022-02-22  8:45         ` Mel Gorman
2022-02-22  9:39           ` K Prateek Nayak

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=a57dbac2-1b8e-ea5c-8b6c-3a97ac186ad9@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=efault@gmx.de \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.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 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®