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]
Message-ID: <1370439386.9844.12.camel@gandalf.local.home>
Date:	Wed, 05 Jun 2013 09:36:26 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	"Paul E. McKenney" <paulmck@...ibm.com>,
	LKML <linux-kernel@...r.kernel.org>, Tejun Heo <tj@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>
Subject: Re: [RFC][PATCH] ftrace: Use schedule_on_each_cpu() as a heavy
 synchronize_sched()

On Wed, 2013-06-05 at 13:51 +0200, Peter Zijlstra wrote:

> > @@ -456,9 +471,13 @@ static int __unregister_ftrace_function(
> >  	/*
> >  	 * Dynamic ops may be freed, we must make sure that all
> >  	 * callers are done before leaving this function.
> > +	 *
> > +	 * Again, normal synchronize_sched() is not good enough.
> > +	 * We need to do a hard force of sched synchronization.
> >  	 */
> >  	if (ops->flags & FTRACE_OPS_FL_DYNAMIC)
> > -		synchronize_sched();
> > +		schedule_on_each_cpu(ftrace_sync);
> > +
> >  
> >  	return 0;
> >  }
> > 
> 
> So what happens if schedule_on_each_cpu() returns -ENOMEM? :-)

Hah! I was thinking the same thing when I wrote it, but as this was just
an RFC, I wanted to hear more about this current approach before adding
more.

I was going to also add something like this:

	if (schedule_on_each_cpu(ftrace_sync) < 0) {
		/*
		 * Crap, memory pressure caused this to fail.
		 * Do a synchronize_sched() and then a msleep().
		 * The race that  fails synchronize_sched() is really small
		 * and a msleep() should clear it (but not guaranteed like
		 * a schedule_on_each_cpu() does).
		 */
		synchronize_sched();
		msleep(5);
	}

-- Steve


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