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

!MAILaRCHIVE_VOTE_RePLACE
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 - 2:34 pm

On Wed, Sep 26, 2007 at 09:40:20AM -0400, Erez Zadok wrote:

There are some places in generic code where it makes sense, e.g.:
  #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)

If you run into a BUG() it's anyway game over.

And there are some rare hotpaths in the kernel where it might make 
sense, and many other places where the likely/unlikely usage that might 
be present doesn't make sense.

Unless you know you need it you simply shouldn't use likely/unlikely.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
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..., Adrian Bunk, (Wed Sep 26, 2:34 pm)
[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)