From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200AbbKJSm7 (ORCPT ); Tue, 10 Nov 2015 13:42:59 -0500 Received: from mga11.intel.com ([192.55.52.93]:40333 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbbKJSmy (ORCPT ); Tue, 10 Nov 2015 13:42:54 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,271,1444719600"; d="scan'208";a="682357551" Date: Tue, 10 Nov 2015 10:41:59 -0800 From: Jacob Pan To: Peter Zijlstra Cc: LKML , Rafael Wysocki , Len Brown , Andi Kleen , Thomas Gleixner , Paul Turner , Tim Chen , Dietmar Eggemann , Eduardo Valentin , Punit Agrawal , Srinivas Pandruvada , jacob.jun.pan@linux.intel.com Subject: Re: [RFC PATCH v2 3/3] sched: introduce synchronized idle injection Message-ID: <20151110104159.022758a3@icelake> In-Reply-To: <20151110132324.GC17308@twins.programming.kicks-ass.net> References: <1447114883-23851-1-git-send-email-jacob.jun.pan@linux.intel.com> <1447114883-23851-4-git-send-email-jacob.jun.pan@linux.intel.com> <20151110132324.GC17308@twins.programming.kicks-ass.net> Organization: OTC X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Nov 2015 14:23:24 +0100 Peter Zijlstra wrote: > > +/* protect injection parameters from runtime changes */ > > +static DEFINE_SPINLOCK(idle_inject_lock); > > A global lock, yay :-), I think you want this to be a RAW_SPINLOCK > though. As on -RT this would want to actually run from IRQ context > too. > I am not using this lock in per cpu timer handler, I guess it would not be in IRQ context? > > + if (bitmap_weight(idle_inject_cpumask, > > num_possible_cpus())) { > > I don't get the point of this bitmap; with the cpu notifier you > basically ensure this is equal to online_mask. > > Also, this weight test is pointless, if the bitmap is empty the > for_each_set_bit() should be of equal cost -- and afaict nothing > calling this is performance critical in the first place. Agreed, I will remove that. I was planning on a subset of CPUs but not for now, e.g. a socket or domain.