Re: ldcw inline assembler patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 16, 2008 at 6:05 PM, Matthew Wilcox <matthew@xxxxxx> wrote:
> The only users of __ldcw() are in spinlock.h which has the mb()s in
> place.  I don't think there's a problem here.

Given:
mb()
__ldcw(a)
mb()

What stops the compiler from doing?

mb()
*stack_slot = *a
reg1 = *stack_slot
reg2 = __ldcw(reg1)
*a = *stack_slot
mb()

Memory is consistent before and after the memory barriers, but the
operation is not atomic?

While this seems stupid, the compile may create a memory temporary to
shuffle things around.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux