linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 00/10] incorrect unlikely() and likely() cleanups
@ 2010-12-07  1:58 Steven Rostedt
  2010-12-07  1:58 ` [RFC][PATCH 01/10] sched: Change rt_task(prev) in pre_schedule_rt to likely Steven Rostedt
                   ` (9 more replies)
  0 siblings, 10 replies; 31+ messages in thread
From: Steven Rostedt @ 2010-12-07  1:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton

This is my end of year branch annotation cleanups. I compiled my
kernel with:

CONFIG_PROFILE_ANNOTATED_BRANCHES

And booted this on my main work station, as well as a couple of
test boxes. Letting it run for a while I then looked at the results.

 cat /debug/tracing/trace_stat/branch_annotated

Which gives a result looking something like this:

 correct incorrect  %        Function                  File              Line
 ------- ---------  -        --------                  ----              ----
       0 366631256 100 sched_info_switch              sched_stats.h        269
       0 211488512 100 sched_info_queued              sched_stats.h        222
       0 197083456 100 sched_info_dequeued            sched_stats.h        177
       0 130545377 100 syscall_trace_enter            ptrace.c             1375
       0 130545340 100 syscall_trace_leave            ptrace.c             1403
       0   326960 100 pre_schedule_rt                sched_rt.c           1476
       0     5214 100 signal_pending                 sched.h              2313
       0     1305 100 trylock_page                   pagemap.h            316

It sorts the list with those that have the highest percentage of
incorrect uses and the largest number of them.

The sched_info_switch() is part of the sched_stats which falls into:

	if (unlikely(1))

And gcc is smart enough to ignore it, but because it uses a static
inline function that returns 1, the branch profiler misses that it
is indeed a constant.

I also ignored those that only had a few hits, like the signal_pending
above.

Anyway, there are 10 areas that I found that really do not need to have
an annotated branch, or the annotation is simply the opposite of
what it should be.

If people are fine with these, I'm hoping to get acks and then push this
out as a real clean up for 2.6.38.


The following patches are in:

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

    branch: unlikely/core


Steven Rostedt (10):
      sched: Change rt_task(prev) in pre_schedule_rt to likely
      mm: Remove likely() from mapping_unevictable()
      workqueue: It is likely that WORKER_NOT_RUNNING is true
      sched: Change pick_next_task_rt from unlikely to likely
      mm: Remove likely() from grab_cache_page_write_begin()
      sched: Remove unlikely() from rt_policy() in sched.c
      x86: Remove unlikey()'s from sched_switch segment tests
      fs: Remove unlikely() from fput_light()
      fs: Remove unlikely() from fget_light()
      sched: Remove unlikely() from ttwu_post_activation

----
 arch/x86/kernel/process_64.c |    6 +++---
 fs/file_table.c              |    2 +-
 include/linux/file.h         |    2 +-
 include/linux/pagemap.h      |    2 +-
 kernel/sched.c               |    4 ++--
 kernel/sched_rt.c            |    4 ++--
 kernel/workqueue.c           |    4 ++--
 mm/filemap.c                 |    2 +-
 8 files changed, 13 insertions(+), 13 deletions(-)

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

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

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-07  1:58 [RFC][PATCH 00/10] incorrect unlikely() and likely() cleanups Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 01/10] sched: Change rt_task(prev) in pre_schedule_rt to likely Steven Rostedt
2010-12-07  3:25   ` Yong Zhang
2010-12-07  3:32     ` Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 02/10] mm: Remove likely() from mapping_unevictable() Steven Rostedt
2010-12-07  2:22   ` Steven Rostedt
2010-12-07  7:02     ` Nick Piggin
2010-12-07 13:06       ` Steven Rostedt
2010-12-07 16:26     ` Rik van Riel
2010-12-10  7:00     ` KOSAKI Motohiro
2010-12-10  7:06       ` Joe Perches
2010-12-10  8:08         ` Miles Bader
2010-12-11  0:09           ` Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 03/10] workqueue: It is likely that WORKER_NOT_RUNNING is true Steven Rostedt
2010-12-07  9:49   ` Tejun Heo
2010-12-07 13:07     ` Steven Rostedt
2010-12-11  0:08     ` Steven Rostedt
2010-12-11  0:09       ` Tejun Heo
2010-12-11  0:12         ` Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 04/10] sched: Change pick_next_task_rt from unlikely to likely Steven Rostedt
2010-12-07  2:46   ` Gregory Haskins
2010-12-07  2:59     ` Steven Rostedt
2010-12-11  0:07     ` Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 05/10] mm: Remove likely() from grab_cache_page_write_begin() Steven Rostedt
2010-12-07  2:24   ` Steven Rostedt
2010-12-07  6:56     ` Nick Piggin
2010-12-07  1:58 ` [RFC][PATCH 06/10] sched: Remove unlikely() from rt_policy() in sched.c Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 07/10] x86: Remove unlikey()s from sched_switch segment tests Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 08/10] fs: Remove unlikely() from fput_light() Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 09/10] fs: Remove unlikely() from fget_light() Steven Rostedt
2010-12-07  1:58 ` [RFC][PATCH 10/10] sched: Remove unlikely() from ttwu_post_activation Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).