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, 10 Oct 2013 07:55:32 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	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/6] hotplug: Optimize {get,put}_online_cpus()

On Thu, Oct 10, 2013 at 01:06:16PM +0200, Oleg Nesterov wrote:
> On 10/09, Andrew Morton wrote:
> >
> > On Tue, 08 Oct 2013 12:25:06 +0200 Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > > The current implementation of get_online_cpus() is global of nature
> > > and thus not suited for any kind of common usage.
> > >
> > > Re-implement the current recursive r/w cpu hotplug lock such that the
> > > read side locks are as light as possible.
> > >
> > > The current cpu hotplug lock is entirely reader biased; but since
> > > readers are expensive there aren't a lot of them about and writer
> > > starvation isn't a particular problem.
> > >
> > > However by making the reader side more usable there is a fair chance
> > > it will get used more and thus the starvation issue becomes a real
> > > possibility.
> > >
> > > Therefore this new implementation is fair, alternating readers and
> > > writers; this however requires per-task state to allow the reader
> > > recursion.
> >
> > Obvious question: can't we adapt lglocks for this?  It would need the
> > counter in task_struct to permit reader nesting, but what else is
> > needed?
> 
> Unlikely. If nothing else, get_online_cpus() is might_sleep().
> 
> But we can joing this with percpu_rw_semaphore (and I am going to try
> to do this). Ignoring the counter in task_struct this is the same thing,
> but get_online_cpus() is also optimized for the case when the writer
> is pending (percpu_down_read() uses down_read() in this case).

To Andrew's overall question, I believe that by the time we apply
this in the various places where it can help, it will have simplified
things a bit -- and made them faster and more scalable.

							Thanx, Paul

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