mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: "Tony 'Nicoya' Mantler" <nicoya@apia.dhs.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Quick question about hyper-threading
Date: Mon, 14 Apr 2003 07:46:30 -0700	[thread overview]
Message-ID: <10480000.1050331589@[10.10.2.4]> (raw)
In-Reply-To: <nicoya-87F6BA.04060913042003@news.sc.shawcable.net>

> Perhaps the same effect could be obtained by preferentially scheduling 
> processes to execute on the "node" (a node being a single cpu in an SMP 
> system, or an HT virtual CPU pair, or a NUMA node) that they were last 
> running on.

We do that already. In fact, they always do that unless they're explicitly
migrated (in both NUMA and SMP cases) by the rebalancer.

> I think the ideal semantics would probably be something along the lines of:
> 
>  - a newly fork()ed thread executes on the same node as the creating thread
>  - calling exec() sets a "feel free to shuffle me elsewhere" flag
>  - threads are otherwise only shuffled to other nodes when a certain load ratio 
> is exceeded (current-node:idle-node)

Read the code. It does pretty much exactly this already ;-)
Especially look at sched_balance_exec(), and balance_node()

> Unfortunatley the whole idea would seem to fall apart in the case of a 
> fast-spawning thread pool type load. Perhaps there's a way to handle that 
> automatically, or perhaps it would best be left as a scheduler tunable, 
> I don't know.

It does, kind of ... in fact they all stay on the same runqueue. We need
to train the numa rebalancer to move multiple tasks in the case of heavy
imbalances, but it needs some care to avoid migrating short load spikes.
Moving from nr_running snapshots to load averages will probably fix it.

> I seem to recall SGI found great benefit in writing the scheduler in IRIX to 
> work somewhat like this, though the loads on most SGI machines tend to be slow 
> spawning, long running and big memory - the textbook case for reduced node 
> shuffling. Linux would tend to have a much greater variety of load profiles, 
> some of which would be less pleasantly affected.

Right - that's why it's hard ;-) Fixing any one case is easy ... fixing
all of them simultaneously is extremely difficult ;-)

M.


  reply	other threads:[~2003-04-14 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030413031007$5a6f@gated-at.bofh.it>
     [not found] ` <20030413041007$6d72@gated-at.bofh.it>
2003-04-13  9:06   ` Tony 'Nicoya' Mantler
2003-04-14 14:46     ` Martin J. Bligh [this message]
2003-04-13 22:13 Chuck Ebbert
  -- strict thread matches above, loose matches on Subject: below --
2003-04-13  3:13 Timothy Miller
2003-04-13  4:06 ` Robert Love

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='10480000.1050331589@[10.10.2.4]' \
    --to=mbligh@aracnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicoya@apia.dhs.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®