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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 3 Oct 2013 09:27:28 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Oleg Nesterov <oleg@...hat.com>, Mel Gorman <mgorman@...e.de>,
	Rik van Riel <riel@...hat.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...nel.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] hotplug: Optimize {get,put}_online_cpus()

On Thu, Oct 03, 2013 at 04:01:50PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 02, 2013 at 04:56:56PM +0200, Peter Zijlstra wrote:
> > +	if (atomic_dec_and_test(&cpuhp_waitcount))
> > +		wake_up(&cpuhp_writer);
> > +
> > +	goto again:
> >  }
> 
> > +
> > +#define per_cpu_sum(var)						\
> > +({ 									\
> > + 	typeof(var) __sum = 0;						\
> > + 	int cpu;							\
> > + 	for_each_possible_cpu(cpu)					\
> > + 		__sum += per_cpu(var, cpu);				\
> > + 	__sum;								\
> > +)}
> >  
> 
> I just noticed I forgot a refresh..

And including these changes as well.  ;-)

							Thanx, Paul

> +++ b/kernel/cpu.c
> @@ -120,7 +120,7 @@ void __get_online_cpus(void)
>         if (atomic_dec_and_test(&cpuhp_waitcount))
>                 wake_up(&cpuhp_writer);
> 
> -       goto again:
> +       goto again;
>  }
>  EXPORT_SYMBOL_GPL(__get_online_cpus);
> 
> @@ -146,7 +146,7 @@ EXPORT_SYMBOL_GPL(__put_online_cpus);
>         for_each_possible_cpu(cpu)                                      \
>                 __sum += per_cpu(var, cpu);                             \
>         __sum;                                                          \
> -)}
> +})
> 
>  /*
>   * See srcu_readers_active_idx_check() for a rather more detailed explanation.
> 

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