mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	peterz@infradead.org, andi@firstfloor.org
Subject: Re: [PATCH 1/2] Customize sched domain via cpuset
Date: Wed, 2 Apr 2008 06:14:05 -0500	[thread overview]
Message-ID: <20080402061405.197c0c90.pj@sgi.com> (raw)
In-Reply-To: <47F34625.6000600@jp.fujitsu.com>

Hidetoshi wrote:
> Put simply, if the system tend to be idle, then "push to idle" strategy
> works well.  OTOH if the system tend to be busy, then "pull by idle"
> strategy works well.  Else, both strategy will work but besides of all
> there is a question: how much searching cost can you pay?

So each flag has value in some cases ... that much seems reasonable to me.

But you're saying that you'd like to avoid having to turn on both, just to
get the benefit of one of them, in order to avoid the searching costs of
the other flag that was not valuable on that load, right?

But is this necessarily so?  If "pull by idle" is attempted on a system
which tends to be idle, then while it is true that the search for something
to pull will usually find nothing, what does it matter that we wasted some
otherwise idle cycles, looking for pullable, runnable tasks that cannot be
found, on a system that is mostly idle?

If "push to idle" is attempted on a system that is quite busy, then
couldn't that be coded to notice rather quickly if any nearby CPUs are
idle, and not search if there are no idle neighbors.  One could imagine
a word of memory for each smaller domain ("neighborhood") of CPUs (say
all the logical CPUs in a package), with one bit per logical CPU, that
was set if-and-only-if that CPU was in idle.  Then it would be very
quick for all the CPUs in that domain to see if there are (or just
were ... close enough) any idle CPUs, and skip trying to "push to idle"
if that word was all zero bits.  That is, there would be no sense
trying to push to idle if there were no idle CPUs to push to.  The only
writing and the only locking of that word would be from idle loop code,
and only from nearby CPUs in the same small domain, so it would not be
an impediment to large system scaling or a waste of many CPU cycles on
busy systems.

With a little work such as this, we could make it so that anytime you
needed either flag, you could turn on both, and the other one would be
harmless enough ... just a minor consumer of otherwise idle cycles.

Then with that, we could have one flag, that did both.

> It looks easy... but how do you handle if cpusets are overlapping?

Yeah - that part might be challenging.  Would it work to always take
the largest domain balancing requested?

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.940.382.4214

  reply	other threads:[~2008-04-02 11:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 11:26 Hidetoshi Seto
2008-04-01 11:40 ` Andi Kleen
2008-04-01 11:56   ` Peter Zijlstra
2008-04-01 13:29     ` Andi Kleen
2008-04-01 13:38       ` Peter Zijlstra
2008-04-01 11:48 ` Peter Zijlstra
2008-04-01 11:55 ` Paul Jackson
2008-04-01 11:59   ` Peter Zijlstra
2008-04-02  8:39   ` Hidetoshi Seto
2008-04-02 11:14     ` Paul Jackson [this message]
2008-04-03  3:21       ` Hidetoshi Seto
2008-04-03 10:46         ` Peter Zijlstra
2008-04-03 12:56         ` Paul Jackson
2008-04-03 13:14         ` Paul Jackson
2008-04-04  9:10 ` [PATCH 1/2] Customize sched domain via cpuset (v2) Hidetoshi Seto
2008-04-04  9:11 ` [PATCH 2/2] " Hidetoshi Seto
2008-04-10 14:53   ` Peter Zijlstra
2008-04-14  1:45     ` Hidetoshi Seto
2008-04-14 15:38       ` Paul Jackson

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=20080402061405.197c0c90.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=seto.hidetoshi@jp.fujitsu.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

Powered by JetHome