Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1777768rwl; Thu, 6 Apr 2023 00:40:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZuPP/BVzKLgkNj83Qv/QE63V4NLvhf5RWJ6BzN+CBKyEsUuvW0s/K9V74ompNghi53eqBi X-Received: by 2002:a17:906:8450:b0:93e:8791:7d8e with SMTP id e16-20020a170906845000b0093e87917d8emr5286345ejy.2.1680766821843; Thu, 06 Apr 2023 00:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680766821; cv=none; d=google.com; s=arc-20160816; b=dEzdO/v2o7COHCYujdfbAPPDgKJsxdLMzZKEnOZPEywMsMPc6UCX0aw/nvQxJ86rJV uxHJt5RiobhN3449s8QuyxNiv+ZVoJWmYHkm0GLAYUXOk67vG4MFnfPtyYtQq4bEqHXV 6/VzBj3k2KVW0FUTQ9brtPwjC+xdBMWP3D1gYQ7FADk+2/yUJzX8Dd+oXe/xNR6sKHcR Ln1c6yTbE8bMmt4lVrDk3OsfMD8Q4izDxyciW9sEAzmHw1eOpcH09cv6pQIDwTA04B+m FOZNRkhQ0l+i8h0ZwBt/POPirog7T5DsEi72CuA0LiAzb/YzimxcwtANgDtZKncxSUlK RKcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MoneTFHNrHm1CvMkTKFe0BpHprRoUxLmWShJckHDj2I=; b=xGHBkp9xpEnQW4/rdJ8Mtv2X8o0+nfaDaKedPOZn4oHjdV3MAjiPKjz1jMpdHZ3DD5 SYyb3oCiFvtrJROcvfPfGiP9/tWg8mPolJlX0gvKZy/0j1O4x9uv6Se+/gPT9GKqJ6Et Pt1LaNEn/dQV+IREL468WFb5qGq8x33NGFtsaJ8Ro3+r/skCNpqLGxTluyvNsqGSh9ym d0PsnTSYfS9TZyEp8VN6z/5L1eU/P9dFPPVDB4j5m36t/R2MqMFT1+s199Zbx6g0y9KR T0v7wpYekDTmbYA9RIkxBu4Y93hdW+9xKsIoR4ofL51AiKfNKveMPTljku5kIW5vqGss d2RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D6963OF3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a056402160200b005021f0d575dsi94339edv.676.2023.04.06.00.39.56; Thu, 06 Apr 2023 00:40:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=D6963OF3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235582AbjDFHds (ORCPT + 99 others); Thu, 6 Apr 2023 03:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234792AbjDFHdr (ORCPT ); Thu, 6 Apr 2023 03:33:47 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC46B2112 for ; Thu, 6 Apr 2023 00:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=MoneTFHNrHm1CvMkTKFe0BpHprRoUxLmWShJckHDj2I=; b=D6963OF3z0C1n3q4u87jm+NYfK WBNoysKn/KLPrVu9EtWRXP3AHuqZBKlwPVYiDKC/vqHVsKVdu4srup98wUTAqEx8/g83uQ4x82j+c /mmitR4Z6VpjkAgcHlIggZHKcnE/E91ONLoYXb9wEpGNP6fMsSS7LmpQKRmfnTtWBbbNkdCLMrDAI jXu8KUR01AIqcbIAh1t4QjSQxzvtzWrF9veXQk3NqTG0vp7QbyMUKIEbmI53u78sx0MDYSAMdy6Zs 5hrNxLPHewjYTOhDpQ1cQMq8M/SkV5IRS062GpNqVNkLDQDKDzifnvDlSKVF2/utEfimgSKpVtFgM SbfHWKPw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pkK7g-00ASWh-1u; Thu, 06 Apr 2023 07:33:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9FAD63000DC; Thu, 6 Apr 2023 09:33:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 660D1200BFC2F; Thu, 6 Apr 2023 09:33:30 +0200 (CEST) Date: Thu, 6 Apr 2023 09:33:30 +0200 From: Peter Zijlstra To: David Dai Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Saravana Kannan , kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/6] sched/fair: Add util_guest for tasks Message-ID: <20230406073330.GA386572@hirez.programming.kicks-ass.net> References: <20230330224348.1006691-1-davidai@google.com> <20230330224348.1006691-2-davidai@google.com> <20230405081449.GX4253@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 03:54:08PM -0700, David Dai wrote: > On Wed, Apr 5, 2023 at 1:14 AM Peter Zijlstra wrote: > > > > Hi Peter, > > Appreciate your time, > > > On Thu, Mar 30, 2023 at 03:43:36PM -0700, David Dai wrote: > > > @@ -499,6 +509,7 @@ struct sched_avg { > > > unsigned long load_avg; > > > unsigned long runnable_avg; > > > unsigned long util_avg; > > > + unsigned long util_guest; > > > struct util_est util_est; > > > } ____cacheline_aligned; > > > > > > > Yeah, no... you'll have to make room first. > > > > I’m not sure what you mean. Do you mean making room by reducing > another member in the same struct? If so, which member would be a good > fit to shorten? Or do you mean something else entirely? Yeah, as you can see below, this structure is completely filling up the cacheline already so there's no room for another member. I've not looked at this in detail in a little while so I'm not at all sure what would be the easiest way to free up space. Going by the rest of the discusion is seems this is the least of your problems though. > > struct sched_avg { > > /* typedef u64 -> __u64 */ long long unsigned int last_update_time; /* 0 8 */ > > /* typedef u64 -> __u64 */ long long unsigned int load_sum; /* 8 8 */ > > /* typedef u64 -> __u64 */ long long unsigned int runnable_sum; /* 16 8 */ > > /* typedef u32 -> __u32 */ unsigned int util_sum; /* 24 4 */ > > /* typedef u32 -> __u32 */ unsigned int period_contrib; /* 28 4 */ > > long unsigned int load_avg; /* 32 8 */ > > long unsigned int runnable_avg; /* 40 8 */ > > long unsigned int util_avg; /* 48 8 */ > > struct util_est { > > unsigned int enqueued; /* 56 4 */ > > unsigned int ewma; /* 60 4 */ > > } __attribute__((__aligned__(8)))util_est __attribute__((__aligned__(8))); /* 56 8 */ > > > > /* size: 64, cachelines: 1, members: 9 */ > > /* forced alignments: 1 */ > > } __attribute__((__aligned__(64))); > > > >