Received: by 10.192.165.156 with SMTP id m28csp573359imm; Fri, 13 Apr 2018 04:19:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+PWAGunTDqcaTJy/LMwPQCbmcGqTAMmeuHeRJaarnMSiuxRY5wNnwPvELTBVSbhG1uXvYq X-Received: by 10.167.128.141 with SMTP id v13mr11138759pff.147.1523618383371; Fri, 13 Apr 2018 04:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523618383; cv=none; d=google.com; s=arc-20160816; b=wfECvTFNEzStf0W+puyfMgakW1P8wDCdqoRHMu/dQxfj2Qx5yZoo4oD+Se6aLCOZ1E wwpBwSXXJxqEh3KLpUWn7aEa3dtckQ35ki//Qqqfb6h9vp7xriRmGL8uGMsg6crbW755 nxCTFT6AKdr3SzxXOo3tCVZY+DF6mHKJ2ZXPW0AOfuwsY7uWMEx2Z0w3EInBymCV/obA bvGM7dm5CEvqQPXnPlJX/u4N4mmWpZmJnO9S6xGfH0jNd0eSwbTpPvXGH96CPpPbfW/c nuKNGm5aZ7w/da9bQlrZyyb3QCiygvIeBOdf+O+u2gXaPOXYzYuOATwceECiWThhaNKB PrcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=VBp2qP1xkz/qhPlM9b08oUezf6lYsOKqTFvFxCbiL6c=; b=SbwO/YZWjR6IrCsx3xilRHNHkaAEKkZGvY9O8eKfo6LHNy6lCZ1c5C934DMbXAiyBv F1ME3Y+XL3BG1s9ioPDSoWc3XxK8AT7oUF8INuoINBx/e8jXUGBJBJeaUHZxRYAst5Kw 8xYf8V9F22qmvy1kxWSb2An5g2MRXTTXmBH3CI+3GsXRRk1l1WO/mESmFT0KnuriDhQX EFIhq5tVQJV5KzU7fejbmK006Y2Sq524BOogXRQ+V6aKuuHCJXqRLUvdOy/y350N5089 6BtsKo2VKU0VjM1aq1EJk4dRpIHL/gBbVYaBYnf8syKPBrGRpR2IkSFzW0dTa8HjO6vc Y1BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si5298248plr.453.2018.04.13.04.19.29; Fri, 13 Apr 2018 04:19:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754140AbeDMLR7 (ORCPT + 99 others); Fri, 13 Apr 2018 07:17:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41456 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753634AbeDMLR6 (ORCPT ); Fri, 13 Apr 2018 07:17:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1FF731435; Fri, 13 Apr 2018 04:17:58 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC0A53F592; Fri, 13 Apr 2018 04:17:55 -0700 (PDT) Date: Fri, 13 Apr 2018 12:17:53 +0100 From: Patrick Bellasi To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Joel Fernandes , Steve Muckle Subject: Re: [PATCH 1/7] sched/core: uclamp: add CPU clamp groups accounting Message-ID: <20180413111753.GT14248@e110439-lin> References: <20180409165615.2326-1-patrick.bellasi@arm.com> <20180409165615.2326-2-patrick.bellasi@arm.com> <20180413084019.GQ4043@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180413084019.GQ4043@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-Apr 10:40, Peter Zijlstra wrote: > On Mon, Apr 09, 2018 at 05:56:09PM +0100, Patrick Bellasi wrote: > > +static inline void init_uclamp(void) > > WTH is that inline? You mean I can avoid the attribute? ... or that I should do it in another way? > > +{ > > + struct uclamp_cpu *uc_cpu; > > + int clamp_id; > > + int cpu; > > + > > + mutex_init(&uclamp_mutex); > > + > > + for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) { > > + /* Init CPU's clamp groups */ > > + for_each_possible_cpu(cpu) { > > + uc_cpu = &cpu_rq(cpu)->uclamp[clamp_id]; > > + memset(uc_cpu, UCLAMP_NONE, sizeof(struct uclamp_cpu)); > > + } > > + } > > Those loops are the wrong way around, this shreds your cache. This is a > slow path so it doesn't much matter, but it is sloppy. Yess... my bad!... good catch! ;) > > > +} -- #include Patrick Bellasi