[PATCH] Cygwin: Implement CPU_SET(3) macros

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Jul 26 07:11:00 GMT 2019


On Jul 25 14:15, Mark Geisert wrote:
> Corinna Vinschen wrote:
> > Hi Mark,
> > 
> > On Jul  1 01:55, Mark Geisert wrote:
> > > Corinna Vinschen wrote:
> > > > On Jun 30 15:59, Mark Geisert wrote:
> > > > > This patch supplies an implementation of the CPU_SET(3) processor
> > > > > affinity macros as documented on the relevant Linux man page.
> > > > > ---
> > > > >    winsup/cygwin/include/sys/cpuset.h | 62 +++++++++++++++++++++++++++---
> > > > >    winsup/cygwin/sched.cc             |  8 ++--
> > > > >    2 files changed, 60 insertions(+), 10 deletions(-)
> > > > > [...]
> > > > > +#define CPU_SETSIZE  1024  // maximum number of logical processors tracked
> > > > > +#define NCPUBITS     (8 * sizeof (__cpu_mask))  // max size of processor group
> > > > > +#define CPU_GROUPMAX (CPU_SETSIZE / NCPUBITS)  // maximum group number
> > > > > -#define __CPUELT(cpu)   ((cpu) / __NCPUBITS)
> > > > > -#define __CPUMASK(cpu)  ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
> > > > > +#define CPU_WORD(cpu) ((cpu) / NCPUBITS)
> > > > > +#define CPU_MASK(cpu) ((__cpu_mask) 1 << ((cpu) % NCPUBITS))
> > > > 
> > > > I wouldn't do that.  Three problems:
> > > > [...]
> > > > There's also the request from Sebastian on the newlib list to
> > > > consolidate the cpuset stuff from RTEMS and Cygwin into a single
> > > > definition.
> > > > [...]
> > > I've also found that taskset isn't working properly on my build system with
> > > the new CPU_SET code, though my other testcases are.  So even as submitted,
> > > and fixed per your comments here, there's a bit more to be done.
> > > 
> > > ..mark
> > 
> > any chance to pick this up again?
> 
> Hi; yes, certainly. I'm back but ill.

I hope it's nothing serious.  Please make sure you're getting well
before diving too deep into code again :)

> It may be a week or so before I have
> an update/fix. Top of my list of pending items that require concentration
> ;-).
> 
> ..mark

Sounds good to me.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20190726/cd81e4fd/attachment.sig>


More information about the Cygwin-patches mailing list