From: Ingo Molnar <mingo@elte.hu>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [3/6] scheduler: Do devirtualization for sched_fair
Date: Mon, 8 Oct 2007 13:42:34 +0200 [thread overview]
Message-ID: <20071008114234.GC22199@elte.hu> (raw)
In-Reply-To: <20071007205956.5C4E71474B@wotan.suse.de>
* Andi Kleen <ak@suse.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
next prev parent reply other threads:[~2007-10-08 11:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-07 20:59 [PATCH] [0/6] Some scheduler changes for sched-devel Andi Kleen
2007-10-07 20:59 ` [PATCH] [1/6] scheduler: Remove some unnecessary gotos in sched.c Andi Kleen
2007-10-08 11:36 ` Ingo Molnar
2007-10-09 19:17 ` Ingo Molnar
2007-10-10 0:55 ` Andi Kleen
2007-10-10 11:25 ` Ingo Molnar
2007-10-10 11:26 ` Ingo Molnar
2007-10-07 20:59 ` [PATCH] [2/6] scheduler: Refactor common code of sleep_on / wait_for_completion Andi Kleen
2007-10-07 22:22 ` [PATCH] [2/6] scheduler: Refactor common code of sleep_on / wait_for_completion v2 Andi Kleen
2007-10-08 11:39 ` Ingo Molnar
2007-10-08 12:03 ` Ingo Molnar
2007-10-07 20:59 ` [PATCH] [3/6] scheduler: Do devirtualization for sched_fair Andi Kleen
2007-10-08 11:42 ` Ingo Molnar [this message]
2007-10-08 12:32 ` Andi Kleen
2007-10-08 12:39 ` Ingo Molnar
2007-10-08 14:33 ` Andi Kleen
2007-10-07 20:59 ` [PATCH] [4/6] scheduler: Refactor normalize_rt_tasks Andi Kleen
2007-10-08 11:44 ` Ingo Molnar
2007-10-07 20:59 ` [PATCH] [5/6] scheduler: Protect important kernel threads against normalize_rt Andi Kleen
2007-10-08 11:51 ` Ingo Molnar
2007-10-08 12:33 ` Andi Kleen
2007-10-08 12:43 ` Ingo Molnar
2007-10-08 13:08 ` Andi Kleen
2007-10-07 20:59 ` [PATCH] [6/6] scheduler: Remove bogus comment in sched_group_set_shares Andi Kleen
2007-10-08 11:52 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071008114234.GC22199@elte.hu \
--to=mingo@elte.hu \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox