public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Yicong Yang <yangyicong@hisilicon.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, linux-kernel@vger.kernel.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, bristot@redhat.com,
	song.bao.hua@hisilicon.com, prime.zeng@huawei.com,
	linuxarm@huawei.com, 21cnbao@gmail.com
Subject: Re: [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu
Date: Thu, 25 Nov 2021 11:17:31 +0000	[thread overview]
Message-ID: <20211125111731.GE3301@suse.de> (raw)
In-Reply-To: <20211124085401.14411-1-yangyicong@hisilicon.com>

On Wed, Nov 24, 2021 at 04:54:01PM +0800, Yicong Yang wrote:
> Commit 56498cfb045d noticed that "When select_idle_cpu starts scanning for
> an idle CPU, it starts with a target CPU that has already been checked
> by select_idle_sibling. This patch starts with the next CPU instead."
> It only changed the scanning start cpu to target + 1 but still leave
> the target in the scanning cpumask. The target still have a chance to be
> checked in the last turn. Fix this by clear the target from the cpus
> to scan.
> 
> Fixes: 56498cfb045d ("sched/fair: Avoid a second scan of target in select_idle_cpu")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

Did you check the performance of this? When I tried something like this
in a different context, I found that the cost of clearing the bit was
more expensive than simply using target + 1. For the target to be
rescanned, the whole mask would have to be scanned as no other CPUs are
idle which is the unlikely case. By clearing the bit, a cost is always
incurred even if the first CPU scanned is idle.

-- 
Mel Gorman
SUSE Labs

  reply	other threads:[~2021-11-25 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24  8:54 [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu Yicong Yang
2021-11-25 11:17 ` Mel Gorman [this message]
2021-11-25 12:46   ` Yicong Yang
2021-11-26  9:38     ` Yicong Yang

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=20211125111731.GE3301@suse.de \
    --to=mgorman@suse.de \
    --cc=21cnbao@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=prime.zeng@huawei.com \
    --cc=rostedt@goodmis.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=vincent.guittot@linaro.org \
    --cc=yangyicong@hisilicon.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