linux-mips
[Top] [All Lists]

smp_mb() in asm-mips/bitops.h

To: linux-mips@linux-mips.org
Subject: smp_mb() in asm-mips/bitops.h
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 07 Jun 2007 16:53:01 +0900 (JST)
Cc: ralf@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
I found some funny usages of smp_mb() in asm-mips/bitops.h:

static inline int test_and_set_bit(unsigned long nr,
        volatile unsigned long *addr)
{
        if (cpu_has_llsc && R10000_LLSC_WAR) {
...
                return res != 0;
        } else if (cpu_has_llsc) {
...
                return res != 0;
        } else {
...
                return retval;
        }

        smp_mb();
}

It looks this smp_mb() never have any effects.  This change is from:

> commit 0004a9dfeaa709a7f853487aba19932c9b1a87c8
> Author: Ralf Baechle <ralf@linux-mips.org>
> Date:   Tue Oct 31 03:45:07 2006 +0000
> 
>     [MIPS] Cleanup memory barriers for weakly ordered systems.

at 2.6.18 development cycle.

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>