Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1368766151.18069.252@driftwood>
Date: Thu, 16 May 2013 23:49:11 -0500
From: Rob Landley <rob@...dley.net>
To: musl@...ts.openwall.com
Cc: musl@...ts.openwall.com
Subject: Re: cpuset/affinity interfaces and TSX lock elision in musl

On 05/16/2013 03:36:58 PM, Rich Felker wrote:
> On Thu, May 16, 2013 at 06:37:01PM +0200, Daniel Cegiełka wrote:
> > 1) Are there any plans to add support for cpuset/affinity  
> interfaces?
> 
> I sat down to do it one day, and it was so ugly I got sick and put it
> off again. Seriously. There's a huge abundance of CPU_*
> macros/functions for manipulating abstract bitsets, but all "cpu set"
> specific for no good reason.
> 
> If anyone wants to volunteer to do these, it would be a big relief to
> me. Some caveats:

Meh, the data format's trivial. It's just that the documentation is in  
an insane place, namely here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/asm/bitops.h

(And no, it can't change because it would break existing binaries. Last  
I checked we still run binaries from 0.0.1 if you enable the ancient  
stuff. Alan Cox thacked people who broke that.)

I ripped the glibc stuff out of my taskset implementation last year:

   http://landley.net/hg/toybox/rev/fb546cc2a022

And the new operations boil down to:

   int x = 255 & (mask[j/sizeof(long)] >> (8*(j&(sizeof(long)-1))));

   mask[j/(2*sizeof(long))] |= digit << 4*(j&((2*sizeof(long))-1));

And yes, all the endianness and word size and such work out right if  
you just compile that for the target in question.

Rob

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.