Skip to contentSkip to conversation

Will ll/sc work from user space?

DISCUSSION David Daney 3 participants 3 messages Sep 19, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

Q: Will ll/sc instructions work from a linux user process ?

If so What happens if there is a context switch between the two?

What happens if the memory location is paged out and then back into a different physical page?

Thanks in advance for any insight into this.

David Daney.

#1 lore raw
Quoted 1 line · David Daney

Q: Will ll/sc instructions work from a linux user process ?

Yep.

Quoted 4 lines

If so What happens if there is a context switch between the two?

What happens if the memory location is paged out and then back into a different physical page?

Then sc will fail.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#2 lore raw
In reply to David Daney

David,

Quoted 1 line

Q: Will ll/sc instructions work from a linux user process ?

As Maciej says, yes.

Quoted 1 line

If so What happens if there is a context switch between the two?

The sc fails.

It fails whenever any interrupt or other exception (perhaps a VM event, for example) happens after the ll but before the sc.

Quoted 2 lines

What happens if the memory location is paged out and then back into a different physical page?

If that happens between the ll and the sc, then you must certainly have got an interrupt.

--
Dominic Sweetman
MIPS Technologies