login
Header Space

 
 

Re: [PATCH 10/25] Unionfs: add un/likely conditionals on copyup ops

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Erez Zadok <ezk@...>
Cc: Kok, Auke <auke-jan.h.kok@...>, <akpm@...>, <linux-kernel@...>, <linux-fsdevel@...>, <viro@...>, <hch@...>
Date: Wednesday, September 26, 2007 - 11:23 am

On Sep 26, 2007, at 09:40:20, Erez Zadok wrote:

Hmm, even still I agree with Auke, you probably use it too much.



Actually due to the performance penalty on some systems I think you  
only want to use it if the chance of succeeding is 99% or better, as  
the benefit if predicted is a cycle or two and the harm if  
mispredicted can be more than 50 cycles, depending on the CPU.  You  
should also remember than in filesystems many "failures" are  
triggered by things like the ld.so library searches, where it  
literally calls access() 20 different times on various possible paths  
for library files, failing the first 19.  It does this once for each  
necessary library.

Typically you only want to add unlikely() or likely() for about 2  
reasons:
   (A)  It's a hot path and the unlikely case is just going to burn a  
bunch of CPU anyways
   (B)  It really is extremely unlikely that it fails (Think physical  
hardware failure)

Anything else is just bogus.

Cheers,
Kyle Moffett

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

Messages in current thread:
[GIT PULL -mm] 00/25 Unionfs updates/cleanups/fixes, Erez Zadok, (Tue Sep 25, 11:09 pm)
[PATCH 01/25] Unionfs: Simplify unionfs_get_nlinks, Erez Zadok, (Tue Sep 25, 11:09 pm)
[PATCH 04/25] Unionfs: cache-coherency fixes, Erez Zadok, (Tue Sep 25, 11:09 pm)
[PATCH 02/25] Unionfs: Remove unused #defines, Erez Zadok, (Tue Sep 25, 11:09 pm)
Re: [PATCH 10/25] Unionfs: add un/likely conditionals on cop..., Kyle Moffett, (Wed Sep 26, 11:23 am)
[PATCH 06/25] Unionfs: minor coding style updates, Erez Zadok, (Tue Sep 25, 11:09 pm)
Re: [PATCH 05/25] Unionfs: cast page-&gt;index loff_t before..., Christoph Hellwig, (Wed Sep 26, 4:31 am)
speck-geostationary