Re: Quick question about hyper-threading

From: Tony 'Nicoya' Mantler (nicoya@apia.dhs.org)
Date: Sun Apr 13 2003 - 04:06:09 EST


In article <20030413041007$6d72@gated-at.bofh.it>, Robert Love <rml@tech9.net>
wrote:

: On Sat, 2003-04-12 at 23:13, Timothy Miller wrote:
[...]
: > Does the HT-aware scheduler attempt to take this into account by scheduling
: > two related threads to run simultaneously on the same CPU as often as
: > possible (unless you're in a multi-processor system and another CPU would
: > otherwise be idle)?
:
:
: No, the current scheduler (HT or stock 2.5) does not do this.
:
: Your theories are correct. It would be interesting to try this and see.
:
: It is nontrivial to do the ->mm checks in the scheduler though -
: certainly they cannot be done easily (if at all) in constant-time (i.e.,
: it won't be O(1)).
[...]

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.

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)

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.

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.

Cheers - Tony 'Nicoya' Mantler :)

-- 
Tony "Nicoya" Mantler - Renaissance Nerd Extraordinaire - nicoya@apia.dhs.org
Winnipeg, Manitoba, Canada           --           http://nicoya.feline.pp.se/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 15 2003 - 22:00:28 EST