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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 6 May 2016 12:47:18 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Peter Zijlstra <peterz@...radead.org>
cc:	Andi Kleen <andi@...stfloor.org>, acme@...nel.org,
	jolsa@...nel.org, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>, x86@...nel.org
Subject: Re: [PATCH 01/10] x86: Add topology_max_smt_threads()

On Fri, 6 May 2016, Peter Zijlstra wrote:
> On Thu, May 05, 2016 at 04:03:58PM -0700, Andi Kleen wrote:
> >  
> >  extern unsigned int __max_logical_packages;
> >  #define topology_max_packages()			(__max_logical_packages)
> > +
> > +extern int max_smt_threads;

Please follow the above convention and prepend it with underscores. That way
it's clear that the variable should not be touched outside of the core which
initializes it.

> > +#define topology_max_smt_threads()		max_smt_threads
> > +

> >  static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
> >  {
> >  	unsigned long flags;
> > @@ -489,6 +492,7 @@ void set_cpu_sibling_map(int cpu)
> >  	struct cpuinfo_x86 *c = &cpu_data(cpu);
> >  	struct cpuinfo_x86 *o;
> >  	int i;
> > +	int threads;

  int i, threads; 

Please

> >  
> >  	cpumask_set_cpu(cpu, cpu_sibling_setup_mask);
> >  
> > @@ -545,6 +549,10 @@ void set_cpu_sibling_map(int cpu)
> >  		if (match_die(c, o) && !topology_same_node(c, o))
> >  			primarily_use_numa_for_topology();
> >  	}
> > +
> > +	threads = cpumask_weight(topology_sibling_cpumask(cpu));
> > +	if (threads > max_smt_threads)
> > +		max_smt_threads = threads;
> >  }
> >  
> >  /* maps the cpu to the sched domain representing multi-core */
> > @@ -1436,6 +1444,21 @@ __init void prefill_possible_map(void)
> >  
> >  #ifdef CONFIG_HOTPLUG_CPU
> >  
> > +/* Recompute SMT state for all CPUs on offline */
> > +static void recompute_smt_state(void)
> > +{
> > +	int max_threads;
> > +	int cpu;

Ditto

> > +
> > +	max_threads = 0;
> > +	for_each_online_cpu (cpu) {
> > +		int threads = cpumask_weight(topology_sibling_cpumask(cpu));

Missing newline.

Otherwise that looks good.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ