From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbcCANRd (ORCPT ); Tue, 1 Mar 2016 08:17:33 -0500 Received: from casper.infradead.org ([85.118.1.10]:60250 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753707AbcCANRb (ORCPT ); Tue, 1 Mar 2016 08:17:31 -0500 Date: Tue, 1 Mar 2016 14:17:24 +0100 From: Peter Zijlstra To: Steve Muckle Cc: "Rafael J. Wysocki" , 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: <20160301131724.GU6357@twins.programming.kicks-ass.net> References: <1456190570-4475-1-git-send-email-smuckle@linaro.org> <1456190570-4475-4-git-send-email-smuckle@linaro.org> <8427745.Y8N2bqC3SO@vostro.rjw.lan> <56CF9D8F.7010607@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CF9D8F.7010607@linaro.org> 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 04:34:23PM -0800, Steve Muckle wrote: > >> + /* > >> + * Ensure that all CPUs currently part of this policy are out > >> + * of the hot path so that if this policy exits we can free gd. > >> + */ > >> + preempt_disable(); > >> + smp_call_function_many(policy->cpus, dummy, NULL, true); > >> + preempt_enable(); > > > > I'm not sure how this works, can you please tell me? > > Peter correctly interpreted my intentions. > > The RCU possibility also crossed my mind. They both seemed like a bit of > a hack to me - this wouldn't really be doing any RCU per se, rather > relying on its implementation. I'll switch to RCU since that seems to be > preferred though. It's certainly cleaner to write. RCU is widely used in this fashion. synchronize_sched() is explicitly constructed to sync against preempt disable sections. This is not an implementation detail.