[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071008114234.GC22199@elte.hu>
Date: Mon, 8 Oct 2007 13:42:34 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Andi Kleen <ak@...e.de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [3/6] scheduler: Do devirtualization for sched_fair
* Andi Kleen <ak@...e.de> wrote:
> Some CPUs like K8 cannot predict indirect calls. A common optimization
> in object oriented languages is to check for the most common call
> target and then call it directly; otherwise do an indirect call. This
> patch does this manually for sched_fair calls in sched.c
[...]
> I unfortunately wasn't able to measure a consistent difference in
> lmbench3 lat_ctx -- the change seems to be below its (large)
> instability.
> + * Simple devirtualization:
> + * Most tasks are fair tasks. Avoid the overhead of
> + * doing indirect calls for them by checking for the fair case and doing
> + * a direct call. Use only in real fast paths since it generates larger code.
> + */
> +#define __CLASS_CALL(class, name, args) \
> + ((class) == &fair_sched_class ? \
> + name ## _fair args : (class)->name args)
> +#define CLASS_CALL(p, name, args) \
> + __CLASS_CALL((p)->sched_class, name, args)
hm, i'm not convinced about this one. It increases the code size a bit
and it's a sched.c local hack. If then this should be done on a generic
infrastructure level - lots of other code (VFS, networking, etc.) could
benefit from it i suspect - and then should be .configurable as well.
Then the benefit might become measurable too.
Ingo
-
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