From: Cyril Bur <cyrilbur@gmail.com>
To: mikey@neuling.org, benh@kernel.crashing.org,
linuxppc-dev@lists.ozlabs.org
Subject: [RFC PATCH 00/12] Deal with TM on kernel entry and exit
Date: Tue, 20 Feb 2018 11:22:29 +1100 [thread overview]
Message-ID: <20180220002241.29648-1-cyrilbur@gmail.com> (raw)
This is very much a proof of concept and if it isn't clear from the
commit names, still a work in progress.
I believe I have something that works - all the powerpc selftests
pass. I would like to get some eyes on it to a) see if I've missed
anything big and b) some opinions on if it is looking like a net
improvement.
Obviously it is still a bit rough around the edges, I'll have to
convince myself that the SPR code is correct. I don't think the
TM_KERNEL_ENTRY macro needs to check that we came from userspace, if
TM is on then we can probably assume. Maybe a check not in the
fastpath. Some of the BUG_ON()s will probably go.
Background:
Currently TM is dealt with when we need to. That is, when we switch
processes, we'll (if nessesary) reclaim the outgoing process and (if
nessesary) recheckpoint the incoming process. Same with signals, if we
need to deliver a signal, we'll ensure we've reclaimed in order to
have all the information and go from there.
I, along with some others got curious to see what it would look like if
we did the 'opposite'.
At all kernel entry points that won't simply just zoom straight to an
RFID we now check if the thread was transactional and do the reclaim.
Correspondingly do the recheckpoint quite late on exception exit. It
turns out we already had a lot of the code pathes set up on the exit
path as there were things that TM had special cased on exit already.
I wasn't sure it it would lead to more or less complexity and though
I'd have to try it to see. I feel like it was almost a win but SPRs
did add some annoying caveats.
In order to get this past Michael I'm going to prove it performs, or
rather, doesn't slow anything down - workload suggestions welcome.
Thanks,
Cyril Bur (12):
powerpc/tm: Remove struct thread_info param from tm_reclaim_thread()
selftests/powerpc: Fix tm.h helpers
selftests/powerpc: Add tm-signal-drop-transaction TM test
selftests/powerpc: Use less common thread names
[WIP] powerpc/tm: Reclaim/recheckpoint on entry/exit
[WIP] powerpc/tm: Remove dead code from __switch_to_tm()
[WIP] powerpc/tm: Add TM_KERNEL_ENTRY in more delicate exception
pathes
[WIP] powerpc/tm: Fix *unavailable_tm exceptions
[WIP] powerpc/tm: Tweak signal code to handle new reclaim/recheckpoint
times
[WIP] powerpc/tm: Correctly save/restore checkpointed sprs
[WIP] powerpc/tm: Afterthoughts
[WIP] selftests/powerpc: Remove incorrect tm-syscall selftest
arch/powerpc/include/asm/exception-64s.h | 25 ++++
arch/powerpc/kernel/entry_64.S | 20 ++-
arch/powerpc/kernel/exceptions-64s.S | 31 ++++-
arch/powerpc/kernel/process.c | 145 ++++++++++++++++++---
arch/powerpc/kernel/ptrace.c | 9 +-
arch/powerpc/kernel/signal.c | 11 +-
arch/powerpc/kernel/signal_32.c | 16 +--
arch/powerpc/kernel/signal_64.c | 41 ++++--
arch/powerpc/kernel/traps.c | 3 -
tools/testing/selftests/powerpc/tm/Makefile | 5 +-
.../powerpc/tm/tm-signal-drop-transaction.c | 74 +++++++++++
.../testing/selftests/powerpc/tm/tm-syscall-asm.S | 28 ----
tools/testing/selftests/powerpc/tm/tm-syscall.c | 106 ---------------
.../testing/selftests/powerpc/tm/tm-unavailable.c | 4 +-
tools/testing/selftests/powerpc/tm/tm.h | 10 +-
15 files changed, 319 insertions(+), 209 deletions(-)
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-drop-transaction.c
delete mode 100644 tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
delete mode 100644 tools/testing/selftests/powerpc/tm/tm-syscall.c
--
2.16.2
next reply other threads:[~2018-02-20 0:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 0:22 Cyril Bur [this message]
2018-02-20 0:22 ` [RFC PATCH 01/12] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread() Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 02/12] selftests/powerpc: Fix tm.h helpers Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 03/12] selftests/powerpc: Add tm-signal-drop-transaction TM test Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 04/12] selftests/powerpc: Use less common thread names Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 05/12] [WIP] powerpc/tm: Reclaim/recheckpoint on entry/exit Cyril Bur
2018-02-20 2:50 ` Michael Neuling
2018-02-20 3:54 ` Cyril Bur
2018-02-20 5:25 ` Michael Neuling
2018-02-20 6:32 ` Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 06/12] [WIP] powerpc/tm: Remove dead code from __switch_to_tm() Cyril Bur
2018-02-20 2:52 ` Michael Neuling
2018-02-20 3:43 ` Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 07/12] [WIP] powerpc/tm: Add TM_KERNEL_ENTRY in more delicate exception pathes Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 08/12] [WIP] powerpc/tm: Fix *unavailable_tm exceptions Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 09/12] [WIP] powerpc/tm: Tweak signal code to handle new reclaim/recheckpoint times Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 10/12] [WIP] powerpc/tm: Correctly save/restore checkpointed sprs Cyril Bur
2018-02-20 3:00 ` Michael Neuling
2018-02-20 3:59 ` Cyril Bur
2018-02-20 5:27 ` Michael Neuling
2018-02-20 0:22 ` [RFC PATCH 11/12] [WIP] powerpc/tm: Afterthoughts Cyril Bur
2018-02-20 0:22 ` [RFC PATCH 12/12] [WIP] selftests/powerpc: Remove incorrect tm-syscall selftest Cyril Bur
2018-02-20 3:04 ` Michael Neuling
2018-02-20 3:42 ` Cyril Bur
2018-06-13 22:38 ` [RFC,00/12] Deal with TM on kernel entry and exit Breno Leitao
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=20180220002241.29648-1-cyrilbur@gmail.com \
--to=cyrilbur@gmail.com \
--cc=benh@kernel.crashing.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).