Thread (11 messages) 11 messages, 5 authors, 2013-10-01

Re: Avoiding the dentry d_lock on final dput(), part deux: transactional memory

From: Michael Neuling <hidden>
Date: 2013-10-01 00:36:14
Also in: linux-fsdevel, lkml

Ben,
On Mon, 2013-09-30 at 12:29 -0700, Linus Torvalds wrote:
quoted
But I'm cc'ing the POWER people, because I don't know the POWER8
interfaces, and I don't want to necessarily call this "xbegin"/"xend"
when I actually wrap it in some helper functions.
The main problem with powerpc TM is that we need to handle interrupts
happening while in transactional state. We currently only handle that
for userspace.
Yep.  
Mikey, how hard would it be to detect the in-kernel TM case and just
simulate an abort in the exception entry ? (return to tbegin basically)
It's doable.

The scary part is that we to make all register volatile.  You were not
that keen on doing this as there are a lot of places in exception
entry/exit where we only save/restore a subset of the registers.  We'd
need to catch all these.
Transactions in kernel make me nervous because of the PC jumping
around on aborts and how easy we can get that stuff wrong :-) 
The same applies for userspace.  We are pretty careful not to screw that
up though.

It's also one of the reason we don't do software rollback of userspace
transactions even in transactional (non-suspended) mode.  We always save
and restore all state and let the HW deal with the PC and state jumping
around.
They also have interesting ordering semantics vs. locks, we need to be
a tad careful (as long as we don't access a lock variable
transactionally we should be ok. If we do, then spin_unlock needs a
stronger barrier).
Yep.
The basic semantic for us is tbegin. [...] tend instructions. If the
transaction fails, control returns to tbegin. (can happen at any
point) which returns a CC code indicating success or failure.
FWIW eg.

     tbegin
     beq abort /* passes first time through */
     ....
     transactional stuff
     ....
     tend
     b pass
     
abort:

pass:
Things get really complicated if you take an interrupt however, the
transaction gets into some special "suspended" state, it doesn't just
die so we need to handle things in our interrupt entry (even if it's
just to make the transaction abort cleanly) and right now we don't
when coming from kernel space.
Yep, but we could check easily enough.

Mikey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help