linux-mips
[Top] [All Lists]

Re: PATCH: Always use ll/sc for mips

To: Jun Sun <jsun@mvista.com>
Subject: Re: PATCH: Always use ll/sc for mips
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Mon, 8 Jul 2002 19:34:38 +0200
Cc: "Kevin D. Kissell" <kevink@mips.com>, "H. J. Lu" <hjl@lucon.org>, linux-mips@oss.sgi.com, GNU C Library <libc-alpha@sources.redhat.com>
In-reply-to: <3D29CA34.1050306@mvista.com>; from jsun@mvista.com on Mon, Jul 08, 2002 at 10:21:56AM -0700
References: <20020702114045.A16197@lucon.org> <20020702220651.B9566@dea.linux-mips.net> <00d401c22337$7e731580$10eca8c0@grendel> <20020704155726.A28268@dea.linux-mips.net> <3D29CA34.1050306@mvista.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5.1i
On Mon, Jul 08, 2002 at 10:21:56AM -0700, Jun Sun wrote:

> > No, Sony's ABI isn't MP proof and will break silently on MP systems.  As
> > such I can't consider it anything else but a hack.  sysmips(MIPS_ATOMIC_SET,
> > ...) and ll/sc however are MP proof.
> > 
> 
> 
> sysmips(MIPS_ATOMIC_SET, ...) as it is is not MP-safe.  Two processors can
> set the variable at the same time since no spinlock is used to protect the
> access. 

Note there are two cases in the code, one using ll/sc which is MP proof
and a second implementation for machines that don't have these instructions.
At least for now Linux/MIPS SMP systems by definition have ll/sc, so I
don't see any problem.

> This is also a problem when I was writing preemptiable kernel patch.

Thanks for the reminder.  I'm just working on the merge with 2.5.4 which
has all the preemption stuff.  Another one for the to-do list ...

  Ralf


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