[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B128F65.40804@redhat.com>
Date: Sun, 29 Nov 2009 17:12:37 +0200
From: Avi Kivity <avi@...hat.com>
To: Tim Blechmann <tim@...ngt.org>
CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] sched: Optimize branch hint in context_switch()
On 11/29/2009 02:01 PM, Tim Blechmann wrote:
> Branch hint profiling on my nehalem machine showed 88%
> incorrect branch hints:
>
> 42017484 326957902 88 context_switch sched.c 3043
> 42038493 326953687 88 context_switch sched.c 3050
>
> @@ -3040,14 +3040,14 @@ context_switch(struct rq *rq, struct task_struct *prev,
> */
> arch_start_context_switch(prev);
>
> - if (likely(!mm)) {
> + if (unlikely(!mm)) {
> next->active_mm = oldmm;
> atomic_inc(&oldmm->mm_count);
> enter_lazy_tlb(oldmm, next);
> } else
> switch_mm(oldmm, mm, next);
>
> - if (likely(!prev->mm)) {
> + if (unlikely(!prev->mm)) {
> prev->active_mm = NULL;
> rq->prev_mm = oldmm;
> }
>
I don't think either the original or the patch is correct. Whether or
not a task has an mm is entirely workload dependent, we shouldn't be
giving hints here.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists