mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Mike Galbraith <efault@gmx.de>, Ingo Molnar <mingo@elte.hu>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH/RFC 1/5] [PATCH] sched: merge cpu_to_core_group functions
Date: Tue, 31 Aug 2010 10:26:06 +0200	[thread overview]
Message-ID: <20100831082606.GA2166@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1281733914.2704.28.camel@sbsiddha-MOBL3.sc.intel.com>

On Fri, Aug 13, 2010 at 02:11:54PM -0700, Suresh Siddha wrote:
> On Thu, 2010-08-12 at 10:25 -0700, Heiko Carstens wrote:
> > diff -urpN linux-2.6/kernel/sched.c linux-2.6-patched/kernel/sched.c
> > --- linux-2.6/kernel/sched.c	2010-08-11 13:47:16.000000000 +0200
> > +++ linux-2.6-patched/kernel/sched.c	2010-08-11 13:47:22.000000000 +0200
> > @@ -6546,31 +6546,23 @@ cpu_to_cpu_group(int cpu, const struct c
> >  #ifdef CONFIG_SCHED_MC
> >  static DEFINE_PER_CPU(struct static_sched_domain, core_domains);
> >  static DEFINE_PER_CPU(struct static_sched_group, sched_group_core);
> > -#endif /* CONFIG_SCHED_MC */
> >  
> > -#if defined(CONFIG_SCHED_MC) && defined(CONFIG_SCHED_SMT)
> >  static int
> >  cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
> >  		  struct sched_group **sg, struct cpumask *mask)
> >  {
> >  	int group;
> > -
> > +#ifdef CONFIG_SCHED_SMT
> >  	cpumask_and(mask, topology_thread_cpumask(cpu), cpu_map);
> >  	group = cpumask_first(mask);
> > +#else
> > +	group = cpu;
> > +#endif
> >  	if (sg)
> >  		*sg = &per_cpu(sched_group_core, group).sg;
> >  	return group;
> >  }
> > -#elif defined(CONFIG_SCHED_MC)
> > -static int
> > -cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
> > -		  struct sched_group **sg, struct cpumask *unused)
> > -{
> > -	if (sg)
> > -		*sg = &per_cpu(sched_group_core, cpu).sg;
> > -	return cpu;
> > -}
> > -#endif
> > +#endif /* CONFIG_SCHED_MC */
> >  
> >  static DEFINE_PER_CPU(struct static_sched_domain, phys_domains);
> >  static DEFINE_PER_CPU(struct static_sched_group, sched_group_phys);
> 
> Reason why this code was structured like this was because of the
> feedback from Andrew Morton. http://lkml.org/lkml/2006/1/27/308

Well, if I wouldn't merge this then the upcoming cpu_to_book_group
function would just be horribly long and unreadable. I think merging
this so it looks the same like cpu_to_phys_group is the right thing
to do.
If I wouldn't do that then the cpu_to_book_group function would just
be a real big mess instead of quite simple function.

  reply	other threads:[~2010-08-31  8:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 17:25 [PATCH/RFC 0/5] sched: add new 'book' scheduling domain Heiko Carstens
2010-08-12 17:25 ` [PATCH/RFC 1/5] [PATCH] sched: merge cpu_to_core_group functions Heiko Carstens
2010-08-13 21:11   ` Suresh Siddha
2010-08-31  8:26     ` Heiko Carstens [this message]
2010-08-12 17:25 ` [PATCH/RFC 2/5] [PATCH] sched: pass sched_domain_level to sched_power_savings_store Heiko Carstens
2010-08-13 21:13   ` Suresh Siddha
2010-08-19 11:36     ` Andreas Herrmann
2010-08-16  8:29   ` Peter Zijlstra
2010-08-19 11:41     ` Andreas Herrmann
2010-08-19 12:35       ` Peter Zijlstra
2010-08-19 12:32         ` Andreas Herrmann
2010-08-12 17:25 ` [PATCH/RFC 3/5] [PATCH] sched: add book scheduling domain Heiko Carstens
2010-08-13 21:22   ` Suresh Siddha
2010-08-16  8:48     ` Peter Zijlstra
2010-08-12 17:25 ` [PATCH/RFC 4/5] [PATCH] topology/sysfs: provide book id and siblings attributes Heiko Carstens
2010-08-12 17:25 ` [PATCH/RFC 5/5] [PATCH] topology: add z196 cpu topology support Heiko Carstens
2010-08-19 12:22 ` [PATCH/RFC 0/5] sched: add new 'book' scheduling domain Andreas Herrmann

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=20100831082606.GA2166@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andreas.herrmann3@amd.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.com \
    --cc=suresh.b.siddha@intel.com \
    /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®