From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3322 Path: news.gmane.org!not-for-mail From: Rob Landley Newsgroups: gmane.linux.lib.musl.general Subject: Re: cpuset/affinity interfaces and TSX lock elision in musl Date: Thu, 16 May 2013 23:49:11 -0500 Message-ID: <1368766151.18069.252@driftwood> References: <20130516203658.GW20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp=Yes; Format=Flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1368766170 9382 80.91.229.3 (17 May 2013 04:49:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 May 2013 04:49:30 +0000 (UTC) Cc: musl@lists.openwall.com To: musl@lists.openwall.com Original-X-From: musl-return-3326-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 17 06:49:31 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UdCbf-0005ev-Gz for gllmg-musl@plane.gmane.org; Fri, 17 May 2013 06:49:27 +0200 Original-Received: (qmail 22135 invoked by uid 550); 17 May 2013 04:49:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22127 invoked from network); 17 May 2013 04:49:26 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:subject:to:cc:in-reply-to:x-mailer:message-id :mime-version:content-type:content-disposition :content-transfer-encoding:x-gm-message-state; bh=pjFOem5wJJwGBc+8IoTflEPDr5xzQhLVZZC1XN0JoAw=; b=l05UBIf4C6yPnriuYAcQ2dPPCoFfoKRpHfPgFlWIXn5OWzaMsfabrGGqS46nddWkgp uBlCumZsYssJ7cIgsT/tjvRWwUiZD4ZwamHoEPQjcNoSldR8VF0XptNJW/P6WlT0tnH9 PgTkOoBI54zDvX01Jl/K3hAh3IHxBC6AQUba327+w3dukXOB79rNSFKezv/JAYNvXxa6 IpTXZa3YM+28ufnmDhDYA9ePoum198Vbiv3IS/WEjoF8Eutw5p/M/JybAf9ukdEZe4WL Hy697ytMhHg7IKDPPMwh6W2YCDhXxJE+fk8OIXoC259oruZLMC+ShISSTDB4FOFCVYa3 +AOA== X-Received: by 10.50.114.131 with SMTP id jg3mr11863486igb.75.1368766154388; Thu, 16 May 2013 21:49:14 -0700 (PDT) In-Reply-To: <20130516203658.GW20323@brightrain.aerifal.cx> (from dalias@aerifal.cx on Thu May 16 15:36:58 2013) X-Mailer: Balsa 2.4.11 Content-Disposition: inline X-Gm-Message-State: ALoCoQlt2NjrsVDcnbGmkrw8dtzzHcGYPX65NN32k/5UQMp+TNz3V+8Yd0uw16cQHKdlAs0sgx98 Xref: news.gmane.org gmane.linux.lib.musl.general:3322 Archived-At: On 05/16/2013 03:36:58 PM, Rich Felker wrote: > On Thu, May 16, 2013 at 06:37:01PM +0200, Daniel Cegie=C5=82ka wrote: > > 1) Are there any plans to add support for cpuset/affinity =20 > interfaces? >=20 > 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. >=20 > 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 =20 an insane place, namely here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/p= owerpc/include/asm/bitops.h (And no, it can't change because it would break existing binaries. Last =20 I checked we still run binaries from 0.0.1 if you enable the ancient =20 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 =3D 255 & (mask[j/sizeof(long)] >> (8*(j&(sizeof(long)-1)))); mask[j/(2*sizeof(long))] |=3D digit << 4*(j&((2*sizeof(long))-1)); And yes, all the endianness and word size and such work out right if =20 you just compile that for the target in question. Rob=