From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3318 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cpuset/affinity interfaces and TSX lock elision in musl Date: Thu, 16 May 2013 16:36:58 -0400 Message-ID: <20130516203658.GW20323@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1368736631 4431 80.91.229.3 (16 May 2013 20:37:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 May 2013 20:37:11 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3322-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 16 22:37:12 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 1Ud4vI-0002he-9s for gllmg-musl@plane.gmane.org; Thu, 16 May 2013 22:37:12 +0200 Original-Received: (qmail 30476 invoked by uid 550); 16 May 2013 20:37:11 -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 30467 invoked from network); 16 May 2013 20:37:11 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3318 Archived-At: 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: 1. The glibc versions invoke UB by accessing past the end of the __bits array in the macros that work with arbitrary-size sets. A correct version would just cast the input pointer to a pointer to unsigned long. 2. The glibc version has buggy overflow checks that were just fixed in their git (so don't coppy the buggy logic). 3. These macros are sufficiently complex that they probably quality as actual-code (with copyrightable content) in header files, and I don't like that. Maybe we should make the external functions instead? Discussion of these points and other ideas for implementing them is welcome. > 2) The upcoming glibc will have support for TSX lock elision. > > http://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions > > http://lwn.net/Articles/534761/ > > Are there any outlook that we can support TSX lock elision in musl? I was involved in the discussions about lock elision on the glibc mailing list, and from what I could gather, it's a pain to implement and whether it brings you any benefit is questionable. Before making any decision, I think we should wait to see some performance figures. Rich