linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* AArch64 arch_spin_unlock not signaling global event?
@ 2013-07-31 20:19 Andrei E. Warkentin
  2013-07-31 21:25 ` Christopher Covington
  2013-08-01  8:48 ` Will Deacon
  0 siblings, 2 replies; 5+ messages in thread
From: Andrei E. Warkentin @ 2013-07-31 20:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hiya,

I've noticed the AArch64 arch_spin_unlock is implemented with the
'stlr' instruction.

Shouldn't that be followed by a 'sev'?

The AArch64 ISA doc says this about 'sev' - "A memory transaction
which clears a processor?s global exclusive monitor also implicitly
generates an event for that processor, as held in the Event register
and used by the WFE instruction."

...but 'stlr' is not an exclusive function. So an 'stlr' would not
generate the event. This means that a arch_spin_lock sitting inside
the 'wfe' would not unblock.

I ran into this doing some kernel-less SMP experiments with the
Foundation Model, where two cpus would play 'ping-pong' acquiring the
same lock and releasing it after a delay, letting the other CPU
acquire it. In the case of the Linux kernel, the core running
arch_spin_unlock likely manipulates a dozen other locks afterwards or
performs other activities which result in a global event (clrex, wfe),
or the other core gets an event because of an interrupt (or timer used
as wfe source). This is why I'm guessing no one has run into this yet.

Cheers,
-- 
A

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-02 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 20:19 AArch64 arch_spin_unlock not signaling global event? Andrei E. Warkentin
2013-07-31 21:25 ` Christopher Covington
2013-08-01  8:48 ` Will Deacon
2013-08-01 10:23   ` Andrei E. Warkentin
2013-08-02 10:11     ` Will Deacon

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).