From: Ingo Molnar <mingo@elte.hu>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, peterz@infradead.org
Subject: Re: [PATCH] [4/4] SCHED: Use a lookup array in sd_level_to_string
Date: Wed, 12 Nov 2008 19:43:21 +0100 [thread overview]
Message-ID: <20081112184321.GF4562@elte.hu> (raw)
In-Reply-To: <20081112144709.GB2672@cmpxchg.org>
* Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Wed, Nov 12, 2008 at 01:45:12PM +0100, Andi Kleen wrote:
> >
> > Generates better/shorter code. Doesn't matter much because it's only
> > a SCHED_DEBUG function.
> >
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> >
> > ---
> > kernel/sched.c | 29 +++++++++++------------------
> > 1 file changed, 11 insertions(+), 18 deletions(-)
> >
> > Index: linux-2.6.28-rc4-test/kernel/sched.c
> > ===================================================================
> > --- linux-2.6.28-rc4-test.orig/kernel/sched.c 2008-11-12 12:36:23.000000000 +0100
> > +++ linux-2.6.28-rc4-test/kernel/sched.c 2008-11-12 12:43:58.000000000 +0100
> > @@ -6629,24 +6629,17 @@
> >
> > static inline const char *sd_level_to_string(enum sched_domain_level lvl)
> > {
> > - switch (lvl) {
> > - case SD_LV_NONE:
> > - return "NONE";
> > - case SD_LV_SIBLING:
> > - return "SIBLING";
> > - case SD_LV_MC:
> > - return "MC";
> > - case SD_LV_CPU:
> > - return "CPU";
> > - case SD_LV_NODE:
> > - return "NODE";
> > - case SD_LV_ALLNODES:
> > - return "ALLNODES";
> > - case SD_LV_MAX:
> > - return "MAX";
> > -
> > - }
> > - return "MAX";
> > + static const char *lva[] = {
> > +#define T(x) [SD_LV_ ## x ] = #T
>
> Shouldn't ^ that be x?
hasnt been tested i guess. Note that the patch is moot: an equivalent
change has been done in the scheduler tree already, in a cleaner way.
It's all in linux-next.
Ingo
prev parent reply other threads:[~2008-11-12 18:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 12:45 [PATCH] [0/4] SCHED: Trivial scheduler fixes Andi Kleen
2008-11-12 12:45 ` [PATCH] [1/4] SCHED: cache task_hot result Andi Kleen
2008-11-12 12:45 ` [PATCH] [2/4] SCHED: Mark all frequently used sysctls __read_mostly Andi Kleen
2008-11-12 12:45 ` [PATCH] [3/4] SCHED: don't inline idle_balance into schedule() Andi Kleen
2008-11-12 12:45 ` [PATCH] [4/4] SCHED: Use a lookup array in sd_level_to_string Andi Kleen
2008-11-12 14:47 ` Johannes Weiner
2008-11-12 15:28 ` Andi Kleen
2008-11-12 18:43 ` Ingo Molnar [this message]
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=20081112184321.GF4562@elte.hu \
--to=mingo@elte.hu \
--cc=andi@firstfloor.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®