Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753505AbcCRXUd (ORCPT ); Fri, 18 Mar 2016 19:20:33 -0400 Received: from ozlabs.org ([103.22.144.67]:52897 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822AbcCRXUX convert rfc822-to-8bit (ORCPT ); Fri, 18 Mar 2016 19:20:23 -0400 Message-ID: <1458343221.6622.88.camel@neuling.org> Subject: Re: [PATCH v8 3/6] cpufreq: powernv: Remove cpu_to_chip_id() from hot-path From: Michael Neuling To: benh@au1.ibm.com, Shilpasri G Bhat , linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org Cc: ego@linux.vnet.ibm.com, linux-pm@vger.kernel.org, shreyas@linux.vnet.ibm.com, rjw@rjwysocki.net, pc@us.ibm.com, viresh.kumar@linaro.org, anton@samba.org Date: Sat, 19 Mar 2016 10:20:21 +1100 In-Reply-To: <1458340635.3107.89.camel@au1.ibm.com> References: <1454442102-1229-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1454442102-1229-4-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1458273857.6622.75.camel@neuling.org> <1458340635.3107.89.camel@au1.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 867 Lines: 28 On Sat, 2016-03-19 at 09:37 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote: > > > > static int nr_chips; > > +static DEFINE_PER_CPU(unsigned int, chip_id); > > > > /* > > * Note: The set of pstates consists of contiguous integers, the > > @@ -317,9 +318,7 @@ static void powernv_cpufreq_throttle_check(void > > *data) > > > > pmsr = get_pmspr(SPRN_PMSR); > > > > - for (i = 0; i < nr_chips; i++) > > - if (chips[i].id == cpu_to_chip_id(cpu)) > > - break; > > + i = this_cpu_read(chip_id); > > Except it's not a chip_id, so your patch confused me for a good 2mn > ... > Call it chip_idx maybe ? ie, index. Yeah, it was a badly named variable but I changed it even more and Shilpasri rebased it here: http://patchwork.ozlabs.org/patch/599523/ Mikey