From: Mark Geisert <mark@maxrnd.com>
To: cygwin-developers@cygwin.com
Subject: Re: Implement sched_[gs]etaffinity()
Date: Fri, 26 Apr 2019 08:44:00 -0000 [thread overview]
Message-ID: <Pine.BSF.4.63.1904260131370.45639@m0.truegem.net> (raw)
In-Reply-To: <20190417075712.GX3599@calimero.vinschen.de>
On Wed, 17 Apr 2019, Corinna Vinschen wrote:
> On Apr 16 21:31, Mark Geisert wrote:
>> On Tue, 16 Apr 2019, Corinna Vinschen wrote:
>>> On Apr 16 01:19, Mark Geisert wrote:
>>>> Anybody know if one can
>>>> depend on the group membership of the first processor group to apply to all
>>>> groups?
>>>
>>> Maybe https://go.microsoft.com/fwlink/p/?linkid=147914 helps?
>>>
>>> "If the number of logical processors exceeds the maximum group size,
>>> Windows creates multiple groups by splitting the node into n groups,
>>> where the first n-1 groups have capacities that are equal to the group
>>> size."
>>
>> Great; thanks for that.
>>
>>> [...]
>>> Therefore:
>>>
>>> WORD cpu_group = cpu_number / num_cpu_per_group;
>>> KAFFINITY cpu_mask = 1L << (cpu_number % num_cpu_per_group);
>>>
>>> That also means the transposition between the groupless linux system
>>> and the WIndows system is fairly easy.
>>
>> Yes, dealing with an array of unsigned longs vs bitblt ops FTW.
I've been doing research to more fully understand the non-symmetric API
for Windows affinity ops. I came across a non-MS document online that
discusses affinity on Windows with >64 CPUs. The author works on "Process
Lasso", a product that attempts to balance performance of apps across
CPUs.
Anyway, he says processors are divided evenly among groups. One reason
for this is that Windows allocates new processes round-robin among the
processor groups. This won't balance properly if some groups have more
processors than other groups. Here's a link to the doc:
https://bitsum.com/general/the-64-core-threshold-processor-groups-and-windows/
I'm not trying to muddy the waters, I'm just trying to figure out if there
are different processor group assignment methods for different kinds of
systems, SMP vs NUMA for instance.
I don't think the code I've got is robust enough to submit yet. I suppose
I could ship what should work, i.e., single-group processes and threads
and just return ENOSYS for multi-group ops. Or just hold off 'til done.
..mark
next prev parent reply other threads:[~2019-04-26 8:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 4:21 Mark Geisert
2019-04-11 8:26 ` Corinna Vinschen
2019-04-11 8:38 ` Corinna Vinschen
2019-04-11 20:52 ` Mark Geisert
2019-04-12 7:46 ` Corinna Vinschen
2019-04-16 8:19 ` Mark Geisert
2019-04-16 10:45 ` Corinna Vinschen
2019-04-17 4:31 ` Mark Geisert
2019-04-17 7:57 ` Corinna Vinschen
2019-04-26 8:44 ` Mark Geisert [this message]
2019-04-26 8:53 ` Corinna Vinschen
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=Pine.BSF.4.63.1904260131370.45639@m0.truegem.net \
--to=mark@maxrnd.com \
--cc=cygwin-developers@cygwin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).