public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Shrikanth Hegde <sshegde@linux.vnet.ibm.com>,
	<linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@redhat.com>,
	"Valentin Schneider" <vschneid@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	"Swapnil Sapkal" <Swapnil.Sapkal@amd.com>,
	Aaron Lu <aaron.lu@intel.com>, <x86@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH 1/1] sched: Extend cpu idle state for 1ms
Date: Thu, 27 Jul 2023 13:04:13 +0800	[thread overview]
Message-ID: <ZMH6zVe4ezzyoNxr@chenyu5-mobl2> (raw)
In-Reply-To: <79fa8a62-a74e-2623-9f03-1f1af85b6c07@efficios.com>

On 2023-07-26 at 10:07:30 -0400, Mathieu Desnoyers wrote:
> On 7/26/23 04:04, Shrikanth Hegde wrote:
> > 
> > 
> > On 7/26/23 1:00 AM, Mathieu Desnoyers wrote:
> > > Allow select_task_rq to consider a cpu as idle for 1ms after that cpu
> > > has exited the idle loop.
> > > 
> > > This speeds up the following hackbench workload on a 192 cores AMD EPYC
> > > 9654 96-Core Processor (over 2 sockets):
> > > 
> > > hackbench -g 32 -f 20 --threads --pipe -l 480000 -s 100
> > > 
> > > from 49s to 34s. (30% speedup)
> > > 
> > > My working hypothesis for why this helps is: queuing more than a single
> > > task on the runqueue of a cpu which just exited idle rather than
> > > spreading work over other idle cpus helps power efficiency on systems
> > > with large number of cores.
> > >

This looks interesting. And it does help power efficiency but how it could
improve throughput? Is it because of hot cache locality waking up task on
it previous running CPU(because it will be easier to be treated as idle),
or just reducing the time in select_idle_sibling()?
 
> Good point !
> 
> Can you try your benchmark replacing the if () statement above by:
> 
> +       if (sched_clock() < READ_ONCE(rq->idle_end_time) + IDLE_CPU_DELAY_NS &&
> +           READ_ONCE(rq->nr_running) <= 4)

If I understand correctly, this nr_running is to filter the case that the system
is saturated? If that is the case, maybe 
	rq->avg_idle >= sysctl_sched_migration_cost
could be checked in case there is 1 long running task and we don't want to treat this
cpu as 'idle'?

thanks,
Chenyu

  parent reply	other threads:[~2023-07-27  5:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 19:30 [RFC PATCH 1/1] sched: Extend cpu idle state for 1ms Mathieu Desnoyers
2023-07-26  7:33 ` Shrikanth Hegde
2023-07-26  8:04 ` Shrikanth Hegde
2023-07-26 14:07   ` Mathieu Desnoyers
2023-07-26 17:40     ` Shrikanth Hegde
2023-07-26 18:56       ` Mathieu Desnoyers
2023-07-26 19:16         ` Mathieu Desnoyers
2023-08-01  7:24         ` Aaron Lu
2023-08-01 15:03           ` Chen Yu
2023-08-03 20:21           ` Mathieu Desnoyers
2023-08-03  5:53         ` Swapnil Sapkal
2023-08-03 20:12           ` Mathieu Desnoyers
2023-08-05 15:37             ` Shrikanth Hegde
2023-07-27  5:04     ` Chen Yu [this message]
2023-08-01  7:42       ` Aaron Lu
2023-08-04 14:04   ` David Laight

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=ZMH6zVe4ezzyoNxr@chenyu5-mobl2 \
    --to=yu.c.chen@intel.com \
    --cc=Swapnil.Sapkal@amd.com \
    --cc=aaron.lu@intel.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=sshegde@linux.vnet.ibm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=x86@kernel.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