public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Why is taskset still not in util-linux?
Date: Mon, 23 Mar 2020 12:48:50 -0600	[thread overview]
Message-ID: <7339782b-9107-e1c8-6ff8-7a4dd48089b9@SystematicSw.ab.ca> (raw)
In-Reply-To: <ee3b6112-dc3e-6245-0abe-8b5410515547@maxrnd.com>

On 2020-03-23 03:42, Mark Geisert wrote:
> Corinna Vinschen wrote:
>> On Mar 21 10:41, Brian Inglis wrote:
>>> On 2020-03-21 02:18, Mark Geisert wrote:
>>>> Eliot Moss wrote:
>>>>> On 3/20/2020 1:54 AM, Mark Geisert wrote:
>>>>>> I've reproduced your snags. It/they are due to my having forgotten
>>>>>> another tiny update that should have been part of the
>>>>>> 2.33.1-cygwin-cpuset.patch file.  If you
>>>>>> 'echo "#define SYS_sched_getaffinity 42" > /usr/local/include/sys/syscall.h'
>>>>>> and then back out your other fix attempts, the build using cygport should
>>>>>> work.
>>>>> Once I did that properly, it built without commenting out that test. Yay!
>>>
>>>> I ended up installing Process Lasso to follow processes among the cpus and to
>>>> test the Cygwin affinity mask implementation.  It has a free trial period.  And
>>>> I wrote a simple test program that just advances from one cpu to the next
>>>> repeatedly, cpu-bound between steps, so PL can display the changing cpu.
>>>
>>> Anyone know if this feature support or what feature support will get top P/last
>>> used CPU and/or procps-ng P/sgi_p currently executing CPU and PSR/currently
>>> assigned CPU showing actual CPUs rather than 0/zero?
>>>
>>> Anyone know if or where or how this info is available on Windows or a link to
>>> it? I've looked at Google and SO results and nothing useful is apparent.
>>
>> Can't we just fake the calls?

The results are currently faked to CPU # 0.

> Brian is asking for a way to watch processes globally, as they are scheduled
> back and forth on the available cpus.  I was a bit sloppy in my wording above;
> what Process Lasso displays is the changing process affinity mask for a process
> I wrote to do just that.  I don't know of a way to ask Windows which cpu a
> process is currently scheduled onto.

You can also get and set affinity in Task Manager, and also ideal CPU info using
SysInternals Process Explorer, or PowerShell, which I use to launch Windows ntpd
at max realtime priority on CPU `nproc` - 1, as CMD arithmetic was nonexistent
or obscure years ago. I could probably redo that with CMD start.

Only documented CPU # call I could find was GetCurrentProcessorNumber (-Ex also
returns processor group) which tells the current thread where it's executing,
not the last or current CPU # assigned or used for other process threads.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

      reply	other threads:[~2020-03-23 18:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 21:46 Eliot Moss
2020-03-04 13:32 ` Mark Geisert
2020-03-16 23:34   ` Mark Geisert
2020-03-19 10:14     ` Eliot Moss
2020-03-19 10:41       ` Marco Atzeri
2020-03-19 23:29       ` Mark Geisert
2020-03-20  5:54         ` Mark Geisert
2020-03-20 10:29           ` Eliot Moss
2020-03-20 21:42             ` Andrey Repin
2020-03-20 13:39           ` Yaakov Selkowitz
2020-03-21  1:46             ` Eliot Moss
2020-03-21  8:37               ` Mark Geisert
2020-03-21 10:24                 ` Eliot Moss
2020-03-21 11:07                   ` Eliot Moss
2020-03-21 13:29                     ` Marco Atzeri
2020-03-21 14:26                     ` Roumen Petrov
2020-03-21 23:13                       ` Eliot Moss
2020-03-22  4:10                         ` Eliot Moss
2020-03-22  5:20                           ` Eliot Moss
2020-03-24  8:09                           ` Mark Geisert
2020-03-24  8:16                             ` Eliot Moss
2020-03-22 20:09                 ` Yaakov Selkowitz
2020-03-21  4:59           ` Eliot Moss
2020-03-21  8:18             ` Mark Geisert
2020-03-21 16:41               ` Brian Inglis
2020-03-23  9:31                 ` Corinna Vinschen
2020-03-23  9:42                   ` Mark Geisert
2020-03-23 18:48                     ` Brian Inglis [this message]

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=7339782b-9107-e1c8-6ff8-7a4dd48089b9@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@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).