lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100831082606.GA2166@osiris.boeblingen.de.ibm.com>
Date:	Tue, 31 Aug 2010 10:26:06 +0200
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Suresh Siddha <suresh.b.siddha@...el.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Mike Galbraith <efault@....de>, Ingo Molnar <mingo@...e.hu>,
	Andreas Herrmann <andreas.herrmann3@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH/RFC 1/5] [PATCH] sched: merge cpu_to_core_group
 functions

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.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ