All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Breno Leitao <leitao@debian.org>
Cc: mikey@neuling.org, ldufour@linux.vnet.ibm.com,
	linuxppc-dev@lists.ozlabs.org, cyrilbur@gmail.com,
	gromero@linux.vnet.ibm.com
Subject: Re: [RFC PATCH v2 00/14] New TM Model
Date: Tue, 06 Nov 2018 19:32:25 +0100	[thread overview]
Message-ID: <87zhumkqfa.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <1541508028-31865-1-git-send-email-leitao@debian.org> (Breno Leitao's message of "Tue, 6 Nov 2018 10:40:14 -0200")

* Breno Leitao:

> This  patchset for the hardware transactional memory (TM) subsystem
> aims to avoid spending a lot of time on TM suspended mode in kernel
> space.  It basically changes where the reclaim/recheckpoint will be
> executed.

I assumed that we want to abort on every system call these days?

We have this commit in glibc:

commit f0458cf4f9ff3d870c43b624e6dccaaf657d5e83
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Aug 27 09:42:50 2018 -0300

    powerpc: Only enable TLE with PPC_FEATURE2_HTM_NOSC
    
    Linux from 3.9 through 4.2 does not abort HTM transaction on syscalls,
    instead it suspend and resume it when leaving the kernel.  The
    side-effects of the syscall will always remain visible, even if the
    transaction is aborted.  This is an issue when transaction is used along
    with futex syscall, on pthread_cond_wait for instance, where the futex
    call might succeed but the transaction is rolled back leading the
    pthread_cond object in an inconsistent state.
    
    Glibc used to prevent it by always aborting a transaction before issuing
    a syscall.  Linux 4.2 also decided to abort active transaction in
    syscalls which makes the glibc workaround superfluous.  Worse, glibc
    transaction abortion leads to a performance issue on recent kernels
    where the HTM state is saved/restore lazily (v4.9).  By aborting a
    transaction on every syscalls, regardless whether a transaction has being
    initiated before, GLIBS makes the kernel always save/restore HTM state
    (it can not even lazily disable it after a certain number of syscall
    iterations).
    
    Because of this shortcoming, Transactional Lock Elision is just enabled
    when it has been explicitly set (either by tunables of by a configure
    switch) and if kernel aborts HTM transactions on syscalls
    (PPC_FEATURE2_HTM_NOSC).  It is reported that using simple benchmark [1],
    the context-switch is about 5% faster by not issuing a tabort in every
    syscall in newer kernels.

I wonder how the new TM model interacts with the assumption we currently
have in glibc.

Thanks,
Florian

  parent reply	other threads:[~2018-11-06 18:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 12:40 [RFC PATCH v2 00/14] New TM Model Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 01/14] powerpc/tm: Reclaim transaction on kernel entry Breno Leitao
2018-11-15  0:06   ` Michael Neuling
2018-11-15  0:51   ` Nicholas Piggin
2018-11-06 12:40 ` [RFC PATCH 02/14] powerpc/tm: Reclaim on unavailable exception Breno Leitao
2018-11-15  0:06   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 03/14] powerpc/tm: Recheckpoint when exiting from kernel Breno Leitao
2018-11-15  0:11   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 04/14] powerpc/tm: Always set TIF_RESTORE_TM on reclaim Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 05/14] powerpc/tm: Refactor the __switch_to_tm code Breno Leitao
2018-11-15  1:04   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 06/14] powerpc/tm: Do not recheckpoint at sigreturn Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 07/14] powerpc/tm: Do not reclaim on ptrace Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 08/14] powerpc/tm: Recheckpoint at exit path Breno Leitao
2018-11-15  2:45   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 09/14] powerpc/tm: Warn if state is transactional Breno Leitao
2018-11-15  2:48   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 10/14] powerpc/tm: Improve TM debug information Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 11/14] powerpc/tm: Save MSR to PACA before RFID Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 12/14] powerpc/tm: Restore transactional SPRs Breno Leitao
2018-11-06 12:40 ` [RFC PATCH 13/14] powerpc/tm: Do not restore TM without SPRs Breno Leitao
2018-11-15  3:02   ` Michael Neuling
2018-11-06 12:40 ` [RFC PATCH 14/14] selftests/powerpc: Adapt tm-syscall test to no suspend Breno Leitao
2018-11-06 18:32 ` Florian Weimer [this message]
2018-11-06 19:31   ` [RFC PATCH v2 00/14] New TM Model Breno Leitao
2018-11-07  0:39     ` Michael Neuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhumkqfa.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=cyrilbur@gmail.com \
    --cc=gromero@linux.vnet.ibm.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.