public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fs: Removal of unlikely likelys
@ 2010-12-14  0:38 Steven Rostedt
  2010-12-14  0:38 ` [PATCH 1/2] fs: Remove unlikely() from fput_light() Steven Rostedt
  2010-12-14  0:38 ` [PATCH 2/2] fs: Remove unlikely() from fget_light() Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2010-12-14  0:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Viro, Christoph Hellwig, Andrew Morton

Not sure who to send this to. I've separated out my patch set
per system, and I'm sending them out individually. You can simply
pull from my repo, or take the patches directly from me.

Or just ignore me and I'll come and bother you again next year ;-)


The following patches are in:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

    branch: unlikely/fs


Steven Rostedt (2):
      fs: Remove unlikely() from fput_light()
      fs: Remove unlikely() from fget_light()

----
 fs/file_table.c      |    2 +-
 include/linux/file.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] fs: Remove unlikely() from fput_light()
  2010-12-14  0:38 [PATCH 0/2] fs: Removal of unlikely likelys Steven Rostedt
@ 2010-12-14  0:38 ` Steven Rostedt
  2010-12-14  0:38 ` [PATCH 2/2] fs: Remove unlikely() from fget_light() Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2010-12-14  0:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Viro, Christoph Hellwig, Andrew Morton

[-- Attachment #1: 0001-fs-Remove-unlikely-from-fput_light.patch --]
[-- Type: text/plain, Size: 1733 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

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>
---
 include/linux/file.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/file.h b/include/linux/file.h
index b1e1297..e85baeb 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -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);
 }
 
-- 
1.7.2.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] fs: Remove unlikely() from fget_light()
  2010-12-14  0:38 [PATCH 0/2] fs: Removal of unlikely likelys Steven Rostedt
  2010-12-14  0:38 ` [PATCH 1/2] fs: Remove unlikely() from fput_light() Steven Rostedt
@ 2010-12-14  0:38 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2010-12-14  0:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Viro, Christoph Hellwig, Andrew Morton

[-- Attachment #1: 0002-fs-Remove-unlikely-from-fget_light.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

There's an unlikely() in fget_light() that assumes the file ref count
will be 1. Running the annotate branch profiler on a desktop that is
performing daily tasks (running firefox, evolution, xchat and is also part
of a distcc farm), it shows that the ref count is not 1 that often.

 correct incorrect      %    Function                  File              Line
 ------- ---------      -    --------                  ----              ----
1035099358 6209599193  85    fget_light              file_table.c         315

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/file_table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index c3dee38..c3e89ad 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -311,7 +311,7 @@ struct file *fget_light(unsigned int fd, int *fput_needed)
 	struct files_struct *files = current->files;
 
 	*fput_needed = 0;
-	if (likely((atomic_read(&files->count) == 1))) {
+	if (atomic_read(&files->count) == 1) {
 		file = fcheck_files(files, fd);
 	} else {
 		rcu_read_lock();
-- 
1.7.2.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-14  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14  0:38 [PATCH 0/2] fs: Removal of unlikely likelys Steven Rostedt
2010-12-14  0:38 ` [PATCH 1/2] fs: Remove unlikely() from fput_light() Steven Rostedt
2010-12-14  0:38 ` [PATCH 2/2] fs: Remove unlikely() from fget_light() Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox