Skip to content

Commit

Permalink
fs: Remove unlikely() from fput_light()
Browse files Browse the repository at this point in the history
In fput_light(), there's an unlikely(fput_needed), which running on
my normal desktop doing firefox, xchat, evolution and part of my distcc farm,
and running the annotate branch profiler shows that the unlikely is not
very unlikely.

 correct incorrect  %        Function             File              Line
 ------- ---------  -        --------             ----              ----
       0       48 100 fput_light                file.h               26
115828710 897415279  88 fput_light              file.h               26
865271179 5286128445  85 fput_light             file.h               26
19568539  8923664  31 fput_light                file.h               26
12353677  3562279  22 fput_light                file.h               26
  267691    67062  20 fput_light                file.h               26
15014853   348172   2 fput_light                file.h               26
  209258      205   0 fput_light                file.h               26
 1364164        0   0 fput_light                file.h               26

Which gives 1032903812 times it was correct and 6203351846 times it was
incorrect, or 85% incorrect.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Steven Rostedt authored and Al Viro committed Jan 17, 2011
1 parent 2fe17c1 commit c2b3e74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern struct file *alloc_file(struct path *, fmode_t mode,

static inline void fput_light(struct file *file, int fput_needed)
{
if (unlikely(fput_needed))
if (fput_needed)
fput(file);
}

Expand Down

0 comments on commit c2b3e74

Please sign in to comment.