From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751161AbcBZJSw (ORCPT ); Fri, 26 Feb 2016 04:18:52 -0500 Received: from casper.infradead.org ([85.118.1.10]:57175 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbcBZJSt (ORCPT ); Fri, 26 Feb 2016 04:18:49 -0500 Date: Fri, 26 Feb 2016 10:18:43 +0100 From: Peter Zijlstra To: "Rafael J. Wysocki" Cc: Steve Muckle , Ingo Molnar , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Michael Turquette , Ricky Liang Subject: Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection Message-ID: <20160226091843.GX6356@twins.programming.kicks-ass.net> References: <1456190570-4475-1-git-send-email-smuckle@linaro.org> <8427745.Y8N2bqC3SO@vostro.rjw.lan> <20160225092837.GD6357@twins.programming.kicks-ass.net> <1792311.cuUNhUde5n@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1792311.cuUNhUde5n@vostro.rjw.lan> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2016 at 10:08:48PM +0100, Rafael J. Wysocki wrote: > On Thursday, February 25, 2016 10:28:37 AM Peter Zijlstra wrote: > > Its vile though; one should not spray IPIs if one can avoid it. Such > > things are much better done with RCU. Sure sync_sched() takes a little > > longer, but this isn't a fast path by any measure. > > I see, thanks! > > BTW, when cpufreq_update_util() callbacks are removed, I use synchronize_rcu() > to wait for the running ones, but would it be better to use synchronize_sched() > in there instead? So I think we only call the callback with rq->lock held, in which case sync_sched() is good enough. It would allow you to get rid of the rcu_read_{,un}lock() calls as well. The down-side is that it all makes the code a little harder to get, because you're relying on caller context to DTRT.