Skip to contentSkip to conversation

barriers in mutexes?

DISCUSSION Steve Muckle 2 participants 4 messages Feb 3, 2011 – Feb 20, 2011

lore
Share & tools
lore
#0 lore raw

Hello,

Looking at kernel/mutex.c and arch/arm/include/asm/mutex.h, it appears there aren't any memory barriers in the fast path of mutexes. I see this was discussed here a long time back:

http://patchwork.kernel.org/patch/25856/

How was this resolved?

thanks,
Steve

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 9 lines · Steve Muckle

Hello,

Looking at kernel/mutex.c and arch/arm/include/asm/mutex.h, it appears there aren't any memory barriers in the fast path of mutexes. I see this was discussed here a long time back:

http://patchwork.kernel.org/patch/25856/

How was this resolved?

bac4e96 ([ARM] barriers: improve xchg, bitops and atomic SMP barriers)

#2 lore raw
Quoted 10 lines · Russell King - ARM Linux
Quoted 7 lines · Steve Muckle

Looking at kernel/mutex.c and arch/arm/include/asm/mutex.h, it appears there aren't any memory barriers in the fast path of mutexes. I see this was discussed here a long time back:

http://patchwork.kernel.org/patch/25856/

How was this resolved?

bac4e96 ([ARM] barriers: improve xchg, bitops and atomic SMP barriers)

The fast path of mutexes on ARM >= v6 doesn't seem to use these operations - it's just ldrex/strex. Looking at the v7 ARM ARM it seems barriers are still required with ldrex/strex.

thanks,
Steve

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw
Quoted 8 lines · Steve Muckle
Quoted 7 lines · Russell King - ARM Linux
Quoted 6 lines · Steve Muckle

Looking at kernel/mutex.c and arch/arm/include/asm/mutex.h, it appears there aren't any memory barriers in the fast path of mutexes. I see this was discussed here a long time back:

http://patchwork.kernel.org/patch/25856/

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

How was this resolved?

bac4e96 ([ARM] barriers: improve xchg, bitops and atomic SMP barriers)

The fast path of mutexes on ARM >= v6 doesn't seem to use these operations - it's just ldrex/strex. Looking at the v7 ARM ARM it seems barriers are still required with ldrex/strex.

Patch welcome.