Received: by 10.192.165.156 with SMTP id m28csp539150imm; Fri, 13 Apr 2018 03:42:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QT53PWi3MHUekV5ig6O042DyP64/DIGaJMjlWy97HEyKXUb43QRUpg0xcWowuVCY55LgD X-Received: by 10.101.74.146 with SMTP id b18mr3636786pgu.26.1523616150468; Fri, 13 Apr 2018 03:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523616150; cv=none; d=google.com; s=arc-20160816; b=zHakqgJEyC8zoJx2DeWMKbl9NBVA54ndLw2YrsyeVb1o7rn2edn2ZFioFhwHXnBZSA tTKT7eNDBdjmJ3tKJvHWfpJjaKZnN0WhRKru8Ez4HDNTVz5hWS4lqdMK4JEUOTl3wfa3 DNaJs0kbxtshSlH3S9GNkvQfmrjVquvT4JxILvOXbQpcXILSV3GzesT6qBQHaJOk1pv0 N7Wddd2YHr4V+TXY/LODgcknJmmcD0Tv5JVAqvlZ3XWAJj0R2H3SeX1T8f61xdznJcN/ 1H6HejWDDlgGM6rNazqcbwafT2y6DHmB8+mU1oFXBPCvMCEMpelYXXDuz+9K+q4kvAqu qgsw== 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=zE5lypcriVpI6hLoFtzI9ZUTxz56/4Db0m7h5cUhd8M=; b=kKDpzV1MP40+BdeUht33ZaCJipDabj7DtLatWVIOhcFu0vE0ryF3ttjsocsyvuTPN/ pdQiqvEMVONfPhxsAKNXxLdFEZr73JXO0wNL37+nEGlbkGvtxdXsrfualBqO2Ib/ixQ1 6xDlEJdjC195JwjHQcc2v+34BRywUxU7hoLyrmqqobxLxBxqw6kRJzzyj97lPzsQB8Q2 3hq7F9cgbiQ9m48dg3dP8mgimIuSHZ/SsuaAKxH3NiLr/fSktQeKeQbd9ZJjA5uHLn7H 8e9ONWaKFael+IyGjIkcjcHOVp8RmSxxKoddnQ2pTWSrNHcWnVSe96zqs0j3fqmTwTjt YKKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=S1qVegwo; 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 i90si4363545pfj.203.2018.04.13.03.42.16; Fri, 13 Apr 2018 03:42:30 -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=bombadil.20170209 header.b=S1qVegwo; 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 S1753425AbeDMJaN (ORCPT + 99 others); Fri, 13 Apr 2018 05:30:13 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56178 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbeDMJaM (ORCPT ); Fri, 13 Apr 2018 05:30:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=zE5lypcriVpI6hLoFtzI9ZUTxz56/4Db0m7h5cUhd8M=; b=S1qVegwoguAQ1Eu0ITgANHDFg EwMdVlkXz6izCruHbthg1QhHNxro7En8P8TVBDhDZG96gIDF/F2R38D3dYIQ7HVip/r6QzpQXKD+j 5dk+3n3PF7zOmVnCFQ/Zxc0xuJkykkLZnXCC9gqw4IGP5Bwx99InTlgSZPhZYhZf0+BQMasZ6dvg9 40dn00oCGnZf+mpEu+gZjw2oAwBXrD93gYJAlPdoSAIuIGXoCT6oA6HdBvGafWcrn8RxBM4if5WjX ELio1KsBi5/1p2JqRT7lY8EwR0TYq/mWPOCUzqTc0QtvOGtBZt6uLAx1OjtoRC7jmth4eWiosUCd7 DNpB0XFyw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6v20-0004mj-I4; Fri, 13 Apr 2018 09:30:08 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C77FA202A29FD; Fri, 13 Apr 2018 11:30:05 +0200 (CEST) Date: Fri, 13 Apr 2018 11:30:05 +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: <20180413093005.GS4043@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: > +struct uclamp_group { > + /* Utilization clamp value for tasks on this clamp group */ > + int value; > + /* Number of RUNNABLE tasks on this clamp group */ > + int tasks; > +}; > +struct uclamp_cpu { > + /* Utilization clamp value for a CPU */ > + int value; > + /* Utilization clamp groups affecting this CPU */ > + struct uclamp_group group[CONFIG_UCLAMP_GROUPS_COUNT + 1]; > +}; > @@ -811,6 +885,11 @@ struct rq { > unsigned long cpu_capacity; > unsigned long cpu_capacity_orig; > > +#ifdef CONFIG_UCLAMP_TASK > + /* util_{min,max} clamp values based on CPU's active tasks */ > + struct uclamp_cpu uclamp[UCLAMP_CNT]; > +#endif > + > struct callback_head *balance_callback; > > unsigned char idle_balance; So that is: struct rq { struct uclamp_cpu { int value; /* 4 byte hole */ struct uclamp_group { int value; int tasks; } [COUNT + 1]; // size: COUNT+2 * 8 [bytes] } [2]; // size: 2 * COUNT+2 * 8 [bytes] }; Which for the default (4) ends up being 96 bytes, or at least 2 lines. Do you want some alignment such that we don't span more lines? Which touch extra on enqueue/dequeue, at least it's only for tasks that have a clamp set.