Re: generic rwsem [Re: Alpha "process table hang"]

D.W.Howells
2001-04-17T19:21:10Z

Andrea,

> As said the design of the framework to plugin per-arch rwsem implementation
> isn't flexible enough and the generic spinlocks are as well broken, try to
> use them if you can (yes I tried that for the alpha, it was just a mess and
> it was more productive to rewrite than to fix).

Having thought about the matter a bit, I know what the problem is:

As stated in the email with the latest patch, I haven't yet extended this to
cover any architecture but i386. That patch was actually put up for comments,
though it got included anyway.

Therefore, all other archs use the old (and probably) broken implementations!

I'll quickly knock up a patch to fix the other archs. This should also fix
the alpha problem.

As for making the stuff I had done less generic, and more specific, I only
made it more generic because I got asked to by a number of people. It was
suggested that I move the contention functions into lib/rwsem.c and make them
common.

As far as using atomic_add_return() goes, the C compiler cannot make the
fastpath anywhere near as efficient, because amongst other things, I can make
use of the condition flags set in EFLAGS and the compiler can't.

> And it's also more readable and it's not bloated code, 65+110 lines
> compared to 156+148+174 lines.

You do my code an injustice there... I've put comments in mine.

David