Messages in this thread |  | | Date | Sat, 5 May 2001 17:55:47 +0400 | From | Ivan Kokshaysky <> | Subject | Re: [patch] 2.4.4 alpha semaphores optimization |
| |
On Fri, May 04, 2001 at 02:12:40PM -0700, Richard Henderson wrote: > > - removed some mb's for non-SMP > > This isn't correct. Either you need atomic updates or you don't. > If you don't, then you shouldn't be using ll/sc at all.
I don't think so. On a single CPU system we need atomic updates to protect modifying of critical variables from interrupts, and ll/sc sequences guarantee exactly that. But on UP system we don't need memory barriers of any kind (I mean system memory space accesses, not IO, of course), as we don't care about read/write ordering at all.
> If you do > (perhaps to coordinate with devices) then the barriers are required.
For IO space access mb's are required, but ll/sc are of no use, AFAIK.
However, if I understand correctly, the r/w semaphores can't be used from interrupt context, so in this case I'd agree -- this stuff could be made completely non-atomic for UP.
> > - removed non-inline up()/down_xx() when semaphore/waitqueue debugging > > isn't enabled. > > They should still be exported for module compatibility.
If you mean some external modules, then ok. The modules built from the main tree shouldn't have any problems...
Ivan. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |