Re: Patch: linux-2.5.29 __downgrade_write() for CONFIG_RWSEM_GENERIC_SPINLOCK

David Howells (dhowells@redhat.com)
Mon, 29 Jul 2002 08:42:16 +0100


Roman Zippel <zippel@linux-m68k.org> wrote:
> You don't really need that extra argument, testing sem->activity should do
> the same job.
> If you exchange the wakewrite (or sem->activity) test and the
> waiter->flags you can fold it into the next test (this means all the extra
> work would only be done, if we have a writer waiting at the top).

The reason for doing it this way is that it allows the compiler to discard
parts of the function when inlining it since the value is set at compile time
rather than being worked out at runtime. The value itself should be
disappeared entirely by the compiler.

David

-
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/