Enable glibc to take advantage of HTM on Ubuntu 15.04

Bug #1414819 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Fix Released
Undecided
Adam Conrad

Bug Description

This Feature request is to track Ubuntu's glibc to take advatnage of Hardware Transactional memory on Ubuntu 15.04.

Adhmerval is porting eglibc threads mechanism to use hardware transactional memory, and this is a feature we want to have on Ubuntu.

Bugs:
https://bugs.launchpad.net/tasty-taco/+bug/1328210 (HTM exploitation on GLIBC)

Patches upstream:
https://sourceware.org/ml/libc-alpha/2014-08/msg00409.html
https://sourceware.org/ml/libc-alpha/2014-08/msg00410.html
https://sourceware.org/ml/libc-alpha/2014-08/msg00411.html
https://sourceware.org/ml/libc-alpha/2014-08/msg00412.html

I updated the IBM 2.20 branch (used for AT8) with the lock elision patches [1], with the IDs:

powerpc: Add the lock elision using HTM - 1d45200a803939be3316b7ddf442906d544e9d43
powerpc: Add adaptive elision to rwlocks - 0f7cecb9cf4b370c3d72f67e048bb07e238cf110
powerpc: abort transaction in syscalls - 1d19c9bc0dabb1d10c07cf4eec063f9da8406c2f

It should apply cleanly on a 2.20 tree. Also, to enable it you need to explicit configure the build with

--enable-lock-elision=yes

[1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/ibm/2.20/master

Related branches

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-117535 severity-medium targetmilestone-inin1504
Luciano Chavez (lnx1138)
affects: ubuntu → glibc (Ubuntu)
Changed in glibc (Ubuntu):
assignee: nobody → Taco Screen team (taco-screen-team)
Revision history for this message
Steve Langasek (vorlon) wrote :

In speaking with Adam, I understand our target glibc version for 15.04 is 2.21, not 2.20. As 2.21 has not yet been released and validated across Ubuntu's architectures, there's some risk that 2.21 will not be included in 15.04. However, if it's not included for 15.04 we would be shipping 2.19, not 2.20.

Revision history for this message
Breno Leitão (breno-leitao) wrote :

So, I understand that we have two options here:

A) If 2.21 makes Ubuntu 15.04, then we are good in terms of patch, we just need to enable lock elision in gcc build (--enable-lock-elision=yes).

    These are the patch that enable HTM in glibc:
      * 1d45200a803939be3316b7ddf442906d544e9d43
      * 4b45943a6f62cfc239e79ad8902f5c7f71fd13ec
      * 56cf2763819d2f721c98f2b8bcc04a3c673837d3)

B) If 2.21 doesn't make Ubuntu 15.04, then we (IBM) should backport these patch for 2.19 (instead of 2.20), and also enable lock elision in gcc build.

Is it correct?

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1414819] Re: Enable glibc to take advantage of HTM on Ubuntu 15.04

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leitão wrote:
> So, I understand that we have two options here:

> A) If 2.21 makes Ubuntu 15.04, then we are good in terms of patch, we
> just need to enable lock elision in gcc build (--enable-lock-
> elision=yes).

> These are the patch that enable HTM in glibc:
> * 1d45200a803939be3316b7ddf442906d544e9d43
> * 4b45943a6f62cfc239e79ad8902f5c7f71fd13ec
> * 56cf2763819d2f721c98f2b8bcc04a3c673837d3)

> B) If 2.21 doesn't make Ubuntu 15.04, then we (IBM) should backport these
> patch for 2.19 (instead of 2.20), and also enable lock elision in gcc
> build.

> Is it correct?

Yes, I think that's correct.

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2015-02-12 12:33 EDT-------
It will require the upstream fix 6f7415033813c73fde81da60d209297901f35575 as well if you intend to built with a toolchain without HTM builtin support.

Revision history for this message
Breno Leitão (breno-leitao) wrote :

Steve,

Is it already defined what glibc version will be used in 15.04?

Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Revision history for this message
Steve Langasek (vorlon) wrote :

The glibc 2.21 upload is being prepared now, and a feature freeze exception has been filed (bug #1425623).

Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Changed in glibc (Ubuntu):
assignee: Taco Screen team (taco-screen-team) → nobody
Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:
On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Revision history for this message
Breno Leitão (breno-leitao) wrote :

What is the progress for this bug? Are we going to be able to build glibc with HTM support for 15.04?

Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:
On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Adam Conrad (adconrad)
Changed in glibc (Ubuntu):
assignee: nobody → Adam Conrad (adconrad)
Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Revision history for this message
Adam Conrad (adconrad) wrote :

This was uploaded earlier today, it just needs to pass a ton of regression testing before it moves from proposed.

Changed in glibc (Ubuntu):
status: New → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glibc - 2.21-0ubuntu2

---------------
glibc (2.21-0ubuntu2) vivid; urgency=medium

  * debian/patches/powerpc/cvs-ppc-sqrt.diff: Fix sqrt() on powerpc.
  * debian/patches/powerpc/cvs-ppc-sqrtf.diff: Likewise for sqrtf().
  * debian/patches/powerpc/cvs-ppc-pow.diff: Likewise for pow().
  * debian/patches/powerpc/cvs-ppc-feraiseexcept.diff: Fix inline
    feraiseexcept and feclearexcept macro input conversion on PPC.
  * debian/patches/any/submitted-longdouble.diff: Refresh for above.
  * debian/patches/any/local-disable-test-tgmath2.diff: Likewise.
  * debian/patches/any/cvs-logbl-accuracy.diff: Fix ldbl-128ibm logbl.
  * debian/patches/powerpc/local-math-logb.diff: Refresh and move to
    debian/patches/any/local-math-logb.diff, as it's not PPC-specific.
  * debian/patches/any/cvs-localplt-new-readelf.diff: Preemptively
    fix localplt test breakage with binutils 2.26 before it lands.
  * debian/patches/any/cvs-make-typo.diff: Fix typo in elf/Makefile.
  * debian/patches/powerpc/cvs-power7-strncpy.diff: Optimize strncpy
    for POWER7 drastically (10-70%) on strings longer than 16 chars.
  * debian/patches/powerpc/cvs-ppc-tabort-le.diff: Fix TABORT encoding
    when building on toolchains without HTM support (no-op on gcc-4.9)
  * debian/patches/arm/cvs-arm-sfi_breg.diff: Fix LDR_GLOBAL macro.
  * debian/patches/arm/cvs-memcpy-memmove-always-bx.diff: Fix memcpy
    and memmove for the ARM_ALWAYS_BX class of hardware like ArmadaXP.
 -- Adam Conrad <email address hidden> Fri, 20 Mar 2015 15:19:40 -0600

Changed in glibc (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote :

On Tue, Jan 27, 2015 at 03:46:54PM -0000, Breno Leit?o wrote:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.