Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3988891imc; Thu, 14 Mar 2019 09:40:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzV3gxQPGeuwkC1A0/z4ea4lOD74dk7vZlDI21OHCVHwVerPv+jQrCmYTjZUBvWNL+TyGXT X-Received: by 2002:a17:902:d705:: with SMTP id w5mr4405260ply.243.1552581618222; Thu, 14 Mar 2019 09:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552581618; cv=none; d=google.com; s=arc-20160816; b=rppkR2voPvmRBSjtvTdpvgShOMqY7vZ0zHkR1B38KqnN8C1Dt2A7oU7Ojb8a8UJoj1 nzodxbdWiHzkHGp4wnW8PgA81OVH0Kq08LnDkuyBCS/wOo4hh4mWXKhP5ASmy83zejsi n+ruwtujgvE/963lK5AODAyyYSEX9eTPANuDR6m50cYA1Xc/t4daMRGB9WSoowq1+DIo sYh5lAi+UJzPfJoDSC3FB/7Cl9nu0XIncY1jyWj/OyQ1erxZGA1Pexiun2jkrCxLvu2m wBLwvrv436iDdZRAy+c+2KFl7LQHrnRm5F5DWk5vy+LAICFuRR9u6cN4nWdA9080IJ6V V41g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TdPxKhSCPORUgKyJSeR7Of9rvDzrHujfXr7KWt38S/M=; b=CLE8AQSO0Ex58HEnPg1/V//KQocjdbk8yXQvMoEYCH3wExO38vjZ37mnTBR1WkxyVq sGW+WPG1nqYrCDUNggbTzXAsl4JH6slqyRPxEAcxdijZV/FiKyHES90vpTrPRY+AEYTf EtGY0TLEnaTNzwzlTTW67wuvn4yiX+iqqL3ZigBhaBu6u9Ky6O5RDbhk8QNRdolIcXwA y9crRjKeb9b46uhorQm3td7qGd802pPFJFl+fQ4/JVAtHa6CQC0xSJconmlfthtSmPtx JizLcPbD3GTYR3vU6srMyxwlSX8chW7FGg286DS/5qQIzXoLR8nC+HjtF8NhS7kAit7s GypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o+3v5zMk; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si12750144pgh.565.2019.03.14.09.40.02; Thu, 14 Mar 2019 09:40:18 -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=pass header.i=@google.com header.s=20161025 header.b=o+3v5zMk; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbfCNQjX (ORCPT + 99 others); Thu, 14 Mar 2019 12:39:23 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:55292 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfCNQjX (ORCPT ); Thu, 14 Mar 2019 12:39:23 -0400 Received: by mail-it1-f196.google.com with SMTP id w18so5705915itj.4 for ; Thu, 14 Mar 2019 09:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TdPxKhSCPORUgKyJSeR7Of9rvDzrHujfXr7KWt38S/M=; b=o+3v5zMk+4V0e6/vcNI7mhuX+nPbwBnW1vymJKSlDI78SxCqx7IAUjwCOTaZqzNOlY pF1atKo6di+/ifEOAB2cpfP6dmJkKTYnqv2sWPkkhKKwogxdmeb/TNIL8GzcJtYb9atV /tyx5ZGQ5bvu9kUqz61SpjSqdv7TtO/w1TZyG0gZ6PmL4XkQ9nzaEhGxkJWqoliq9+1V GheXSppBkze6/pXXjoeazEcO2JLgagq3mKAEOyBqNVBrIQgZ1QnG3Cx/lw5xoxxLK782 eAU6ObIjHkH4+fPxq15N3vOgqDswtYK5mzah5zHWW2yMrYkWUyvf7d5gwdZ6D/nkUdwU TNDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TdPxKhSCPORUgKyJSeR7Of9rvDzrHujfXr7KWt38S/M=; b=t7ESfyjSWYdixEwiWd/291neiguL/BzBMZBIZwWQv9LzD+bplrBl1j+e/qy+EDqfOx scI58XqyISWEcoxWomH2u0SJbps4elI/ZApmHO/Cg5ZbtnQMJW3D95dUau/5IkJeufoD iCBMZiThM2ZGzGTNjKIDRzfGe5E1OmUzbyd4KT0omRwy+2rq/sU78eVAIn+Q7gB0JamB nRZtnQWnsFGLiS/CVIHCzq6U9GkmSNaZNN8hFfppqfrX+ANvxuUa+pt8ZVna7n9IWpVu 0vwTrVBjBcsaiCmRQGMR+q/pER+3M9qNpQ5nNTb5S55yi/FnbbJJxhH2GQGiwMa7qTjD qN/w== X-Gm-Message-State: APjAAAW0Vh5ZV3wvOw3P6wvKmIhGf4SUARGzSOf9XNRsAoD/G/S0Q0Bf T6KLlbzWYo0F0v4pJIL665ZEN75CWCh1iifNOFCERw== X-Received: by 2002:a24:dd82:: with SMTP id t124mr2814312itf.102.1552581561557; Thu, 14 Mar 2019 09:39:21 -0700 (PDT) MIME-Version: 1.0 References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> <20190314144600.2ulpeipad7jbxyiy@e110439-lin> <20190314154052.345v74snhtc4cqbe@e110439-lin> In-Reply-To: <20190314154052.345v74snhtc4cqbe@e110439-lin> From: Suren Baghdasaryan Date: Thu, 14 Mar 2019 09:39:09 -0700 Message-ID: Subject: Re: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting To: Patrick Bellasi Cc: LKML , linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 14, 2019 at 8:41 AM Patrick Bellasi wrote: > > On 14-Mar 08:29, Suren Baghdasaryan wrote: > > On Thu, Mar 14, 2019 at 7:46 AM Patrick Bellasi wrote: > > > On 13-Mar 14:32, Suren Baghdasaryan wrote: > > > > On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi wrote: > > [...] > > > > > > The rq::uclamp::bucket[clamp_id][] array is scanned every time we need > > > > > to find a new MAX aggregated clamp value for a clamp_id. This operation > > > > > is required only when we dequeue the last task of a clamp bucket > > > > > tracking the current MAX aggregated clamp value. In these cases, the CPU > > > > > is either entering IDLE or going to schedule a less boosted or more > > > > > clamped task. > > The following: > > > > > > The expected number of different clamp values, configured at build time, > > > > > is small enough to fit the full unordered array into a single cache > > > > > line. > > will read: > > The expected number of different clamp values, configured at build time, > is small enough to fit the full unordered array into a single cache > line for the default UCLAMP_BUCKETS configuration of 7 buckets. I think keeping default to be 5 is good. As you mentioned it's a nice round number and keeping it at the minimum also hints that this is not a free resource and the more buckets you use the more you pay. Documentation might say "to fit the full unordered array into a single cache line for configurations of up to 7 buckets". > [...] > > > Got it. From reading the documentation at the beginning my impression > > was that whatever value I choose within allowed 5-20 range it would > > still fit in a cache line. To disambiguate it might be worse > > mentioning that this is true for the default value or for values up to > > 7. Thanks! > > Right, I hope the above proposed change helps to clarify that. > > -- > #include > > Patrick Bellasi