[Top] [All Lists]

Re: PATCH: Always use ll/sc for mips

To: Jun Sun <>
Subject: Re: PATCH: Always use ll/sc for mips
From: Ralf Baechle <>
Date: Mon, 8 Jul 2002 19:34:38 +0200
Cc: "Kevin D. Kissell" <>, "H. J. Lu" <>,, GNU C Library <>
In-reply-to: <>; from on Mon, Jul 08, 2002 at 10:21:56AM -0700
References: <> <> <00d401c22337$7e731580$10eca8c0@grendel> <> <>
User-agent: Mutt/
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 ...


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