* [PATCH 0/3 v2] [GIT PULL] remove unlikelys
@ 2009-03-25 15:45 Steven Rostedt
2009-03-25 15:45 ` [PATCH 1/3 v2] sched: remove unlikely in pre_schedule_rt Steven Rostedt
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-03-25 15:45 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin
Ingo,
The differences between v1 and v2 is that I only included the non
controversial patches. I also modified the change log of pre_schedule_rt
to include the annotated branch profiler output.
I just did a force push, so please use ssh, or verify that only these
three patches are present.
Thanks,
-- Steve
Please pull the latest annotate-branch/cleanups tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
annotate-branch/cleanups
Steven Rostedt (3):
sched: remove unlikely in pre_schedule_rt
sched: remove unlikelys from sched_move_task
mm: remove unlikelys for unlock in rmap.c
----
kernel/sched.c | 4 ++--
kernel/sched_rt.c | 2 +-
mm/rmap.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3 v2] sched: remove unlikely in pre_schedule_rt
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
@ 2009-03-25 15:45 ` Steven Rostedt
2009-03-25 15:45 ` [PATCH 2/3 v2] sched: remove unlikelys from sched_move_task Steven Rostedt
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-03-25 15:45 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin, Steven Rostedt
[-- Attachment #1: 0001-sched-remove-unlikely-in-pre_schedule_rt.patch --]
[-- Type: text/plain, Size: 1309 bytes --]
From: Steven Rostedt <rostedt@goodmis.org>
Impact: clean up
The annotated branch profiler shows that the unlikely used by
pre_schedule_rt is always incorrect. This makes sense because in
sched.c we have:
if (prev->sched_class->pre_schedule)
prev->sched_class->pre_schedule(rq, prev);
And we are saying that prev is unlikely to be an rt task. This looks
more like a likely candidate to me.
Here's the annotated branch profiler output:
correct incorrect % Function File Line
------- --------- - -------- ---- ----
0 4244 100 pre_schedule_rt sched_rt.c 1263
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/sched_rt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index bac1061..537af77 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1260,7 +1260,7 @@ static int pull_rt_task(struct rq *this_rq)
static void pre_schedule_rt(struct rq *rq, struct task_struct *prev)
{
/* Try to pull RT tasks here if we lower this rq's prio */
- if (unlikely(rt_task(prev)) && rq->rt.highest_prio > prev->prio)
+ if (rt_task(prev) && rq->rt.highest_prio > prev->prio)
pull_rt_task(rq);
}
--
1.6.2
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3 v2] sched: remove unlikelys from sched_move_task
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
2009-03-25 15:45 ` [PATCH 1/3 v2] sched: remove unlikely in pre_schedule_rt Steven Rostedt
@ 2009-03-25 15:45 ` Steven Rostedt
2009-03-25 15:45 ` [PATCH 3/3 v2] mm: remove unlikelys for unlock in rmap.c Steven Rostedt
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-03-25 15:45 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin, Steven Rostedt
[-- Attachment #1: 0002-sched-remove-unlikelys-from-sched_move_task.patch --]
[-- Type: text/plain, Size: 1260 bytes --]
From: Steven Rostedt <rostedt@goodmis.org>
Impact: clean up
We seem to be moving running tasks more than non running tasks.
I guess tasks like to move themselves.
These are also candidates for likely:
correct incorrect % Function File Line
------- --------- - -------- ---- ----
0 10027 100 sched_move_task sched.c 8918
0 10027 100 sched_move_task sched.c 8908
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/sched.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 8e2558c..5a60745 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8905,7 +8905,7 @@ void sched_move_task(struct task_struct *tsk)
if (on_rq)
dequeue_task(rq, tsk, 0);
- if (unlikely(running))
+ if (running)
tsk->sched_class->put_prev_task(rq, tsk);
set_task_rq(tsk, task_cpu(tsk));
@@ -8915,7 +8915,7 @@ void sched_move_task(struct task_struct *tsk)
tsk->sched_class->moved_group(tsk);
#endif
- if (unlikely(running))
+ if (running)
tsk->sched_class->set_curr_task(rq);
if (on_rq)
enqueue_task(rq, tsk, 0);
--
1.6.2
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3 v2] mm: remove unlikelys for unlock in rmap.c
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
2009-03-25 15:45 ` [PATCH 1/3 v2] sched: remove unlikely in pre_schedule_rt Steven Rostedt
2009-03-25 15:45 ` [PATCH 2/3 v2] sched: remove unlikelys from sched_move_task Steven Rostedt
@ 2009-03-25 15:45 ` Steven Rostedt
2009-03-25 15:49 ` [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
2009-03-25 16:19 ` Ingo Molnar
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-03-25 15:45 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin, Steven Rostedt
[-- Attachment #1: 0003-mm-remove-unlikelys-for-unlock-in-rmap.c.patch --]
[-- Type: text/plain, Size: 2157 bytes --]
From: Steven Rostedt <rostedt@goodmis.org>
Impact: clean up
The annotated branch profiler shows that the rmap calls are likely
called with unlock set.
correct incorrect % Function File Line
------- --------- - -------- ---- ----
0 46100 100 try_to_unmap_anon rmap.c 1013
0 46100 100 try_to_unmap_anon rmap.c 1005
0 5763 100 try_to_unmap_file rmap.c 1074
0 5763 100 try_to_unmap_file rmap.c 1069
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
mm/rmap.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/rmap.c b/mm/rmap.c
index 1652166..ad62fe0 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1002,7 +1002,7 @@ static int try_to_unmap_anon(struct page *page, int unlock, int migration)
unsigned int mlocked = 0;
int ret = SWAP_AGAIN;
- if (MLOCK_PAGES && unlikely(unlock))
+ if (MLOCK_PAGES && unlock)
ret = SWAP_SUCCESS; /* default for try_to_munlock() */
anon_vma = page_lock_anon_vma(page);
@@ -1010,7 +1010,7 @@ static int try_to_unmap_anon(struct page *page, int unlock, int migration)
return ret;
list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
- if (MLOCK_PAGES && unlikely(unlock)) {
+ if (MLOCK_PAGES && unlock) {
if (!((vma->vm_flags & VM_LOCKED) &&
page_mapped_in_vma(page, vma)))
continue; /* must visit all unlocked vmas */
@@ -1066,12 +1066,12 @@ static int try_to_unmap_file(struct page *page, int unlock, int migration)
unsigned int mapcount;
unsigned int mlocked = 0;
- if (MLOCK_PAGES && unlikely(unlock))
+ if (MLOCK_PAGES && unlock)
ret = SWAP_SUCCESS; /* default for try_to_munlock() */
spin_lock(&mapping->i_mmap_lock);
vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
- if (MLOCK_PAGES && unlikely(unlock)) {
+ if (MLOCK_PAGES && unlock) {
if (!((vma->vm_flags & VM_LOCKED) &&
page_mapped_in_vma(page, vma)))
continue; /* must visit all vmas */
--
1.6.2
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3 v2] [GIT PULL] remove unlikelys
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
` (2 preceding siblings ...)
2009-03-25 15:45 ` [PATCH 3/3 v2] mm: remove unlikelys for unlock in rmap.c Steven Rostedt
@ 2009-03-25 15:49 ` Steven Rostedt
2009-03-25 16:19 ` Ingo Molnar
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-03-25 15:49 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin
On Wed, 25 Mar 2009, Steven Rostedt wrote:
>
> I just did a force push, so please use ssh, or verify that only these
> three patches are present.
Here's the HEAD SHA1:
79210dd022b4d7f6f75aeb7d508a3f75fabaae4c
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3 v2] [GIT PULL] remove unlikelys
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
` (3 preceding siblings ...)
2009-03-25 15:49 ` [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
@ 2009-03-25 16:19 ` Ingo Molnar
4 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2009-03-25 16:19 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
Roland McGrath, Nick Piggin
* Steven Rostedt <rostedt@goodmis.org> wrote:
> Ingo,
>
> The differences between v1 and v2 is that I only included the non
> controversial patches. I also modified the change log of
> pre_schedule_rt to include the annotated branch profiler output.
> mm: remove unlikelys for unlock in rmap.c
> mm/rmap.c | 8 ++++----
the rmap.c thing looks uncontroversial to me, but an MM person
should still have a look and Ack it.
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-03-25 16:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 15:45 [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
2009-03-25 15:45 ` [PATCH 1/3 v2] sched: remove unlikely in pre_schedule_rt Steven Rostedt
2009-03-25 15:45 ` [PATCH 2/3 v2] sched: remove unlikelys from sched_move_task Steven Rostedt
2009-03-25 15:45 ` [PATCH 3/3 v2] mm: remove unlikelys for unlock in rmap.c Steven Rostedt
2009-03-25 15:49 ` [PATCH 0/3 v2] [GIT PULL] remove unlikelys Steven Rostedt
2009-03-25 16:19 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox