Received: by 10.192.165.156 with SMTP id m28csp444717imm; Fri, 13 Apr 2018 01:50:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+tc0uIVc1TCJAQDX3yrGGHca6goqVHFyRbQrZ7f33qPBZIXQ/Ol2VN07HhtqkBAgq3T/2v X-Received: by 2002:a17:902:44c:: with SMTP id 70-v6mr4384734ple.354.1523609415760; Fri, 13 Apr 2018 01:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523609415; cv=none; d=google.com; s=arc-20160816; b=qJQ4H+uVDn72qPed/7MXAi/Ag/swddDNp6KjeYiKqr2jvN34zkPw1WzRTR/XMbEaHC PqlPYHbYtEgb//RGvsRq6ymiUPAk2/jxHHve7NqF/u6BbrIz+hdlEx7jDdv/hdBNK25U C4S3vaXKDCEPdoVabz4eps1hpMfelqdskWJBH0viHyejJobcHJTScFgrYbN7TVRBAVu2 N10Z6Bo0IzKm9vYUx6GsCjIIeMBg3SsFi6pQhWQgp6wPqZTAxnZCb+zfri8vcxBKafzV fRBBsT2vdDHDodvVnXhzFV6vH4y8hhn9kNh+CDZB/js6/seQcqJVKvDPCzh+m4f5Dn+D taNg== 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:dkim-signature:arc-authentication-results; bh=x12pPlyDg8z5FaSrr58q/JsNXSv+6hQpO49lQJX9G9o=; b=bpJC7nR5+ari55QLjxxLxv46X6K+Etw4Ma7nuO6TH8SVOc2clct6PkwyxREFYCAebS sez3SjqLwoFhibUZqvHAGvYBGtyG3IYhhVsMYJnoku88o12Ru8gHr6/a2cyq00o21EdS d9TqsdCBwQqzO3znVlVFyfrldZXmrli6uOWv7PViFyzRr+WsHeclntpoN84rjIevlg/m tC15jVvhlUONAEXWfT+4t06RkSROKzhfJ7Fohke6byRqJNExQG8wXrLYgVFayxYfRN4X KtaDly4za+yABEiaNYlP84g+7KdgtmvHRL/j5vySQUhIJTc/whcRW1zB3JTdLu9+F/Ry ZKKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rgQ+bDeU; 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 t65si3785423pgc.343.2018.04.13.01.50.02; Fri, 13 Apr 2018 01:50:15 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rgQ+bDeU; 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 S1753639AbeDMIkd (ORCPT + 99 others); Fri, 13 Apr 2018 04:40:33 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35842 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeDMIka (ORCPT ); Fri, 13 Apr 2018 04:40:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=x12pPlyDg8z5FaSrr58q/JsNXSv+6hQpO49lQJX9G9o=; b=rgQ+bDeU22Lj5zDX0lrk5KyX8 PiKQGoJ8obrLoIZtFQ+jXSqvW1ITXbrBk/H43Pqs/z8XDuISWTlMQGJgHNRatPlKPVkxtvsETfwAQ XLaxC2ifX3nIKxYOWiQoiYOm4gU7umZ5htaXRtEXRfvCGkICTFLnzAjcChcmTbchbv8sf8RN/PHK1 O7fRoafFKVCz1eZA1JoVOTLFqMGSIuy1UTOSeiAGp4L08bnVfIzCJfA2RjvMxV70k5DU9lpA0+BqO 1QpBYH+nWu8BttNOnLbaCZjIVQGZb0bJMNUVShm60lTKxhGkpdixDfffgtz4ixzd5r1WhdwYb27hK CKAvpTnpg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6uFo-0003iw-Hy; Fri, 13 Apr 2018 08:40:20 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 395172029F86F; Fri, 13 Apr 2018 10:40:19 +0200 (CEST) Date: Fri, 13 Apr 2018 10:40:19 +0200 From: Peter Zijlstra To: Patrick Bellasi 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: <20180413084019.GQ4043@hirez.programming.kicks-ass.net> References: <20180409165615.2326-1-patrick.bellasi@arm.com> <20180409165615.2326-2-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409165615.2326-2-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 09, 2018 at 05:56:09PM +0100, Patrick Bellasi wrote: > +static inline void init_uclamp(void) WTH is that inline? > +{ > + 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. > +}