login
Header Space

 
 

Re: [PATCH] RWSEM: Rewrite rwsem.c and rwsem-spinlock.c more simply.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Robert P. J. Day <rpjday@...>
Cc: Andi Kleen <andi@...>, Linux Kernel Mailing List <linux-kernel@...>, Andrew Morton <akpm@...>
Date: Tuesday, March 25, 2008 - 8:36 am

> i'm not sure what this means -- which of the transformations in that

It is not unsafe, just generates slight worse code.

current is inline assembler and the compiler doesn't know that it could
cache it in a register because it is not marked pure 
for various reasons. That is why current is often cached explicitely
in a local variable to tell the compiler that.

Before you run off and do that everywhere: it is also not a large
win, just a small one unless current is used very often.

-Andi
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] RWSEM: Rewrite rwsem.c and rwsem-spinlock.c more..., Andi Kleen, (Tue Mar 25, 8:36 am)
speck-geostationary