Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4559224pxb; Thu, 14 Oct 2021 07:37:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqWyVWaKX41F0fAkg1pYW+EZKgoHnXQ9iwcxrHHMuyvZjveIE/OTk9URNbk1qN8q7Wx9FA X-Received: by 2002:a65:6158:: with SMTP id o24mr4513929pgv.141.1634222233602; Thu, 14 Oct 2021 07:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634222233; cv=none; d=google.com; s=arc-20160816; b=ZCL6n8CBNPOHwXnwtmilp5+Xqd3Maw0wcIung1GopDr5qlX2LZ+2yyJRKUAZsTNtn7 aSf8W3GekI21J00n0VlCTgYDms/2XTB2ZRdkkIF/kP/bgl62MbiTDvgRnmBG0E7NUHc2 Vw2b++kaNzc+medx9SddPXhR1lxjrAARqDAefqDSyIFXDDGdXRq9LVe9xxXKvd6hHuXO shBCn27e7MZsRPFtg9ZTHPGoKnj/0wRbdvOfGbLFvgRcYDpXF70WUBKMzNFYVXOy5kTh zNJvrIkT0oXfiOVpYvbTTgOsMDxjPy1Gg7SRYY2DQVcW0MA3isZoEaTtDWpjUUz93vqx MZ9Q== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XeOyDQkq1uPXVeW24zX/26vNnS1ATHn1F0LAI5O9ioA=; b=TAOVld+vR1EbvCFbL7ZpOXI7+fBiOZhZvaeofF4Cy9bWoVKWaDC4beLBwYEKZeZV0+ x/chQMrlULXh13pUlkH/qJbgaY912TNzprX3OFmyplwODkXEdN82Etu45fVqwQyS0j3q OVPN4p0TKxt86oRNPjXefok3POpPlBGfyzY1ZvSnNcUxwMehIsZf6yKk2kn82WSyVnvd GLM8lot9AdIvU1xNz6D6AMM6Bf4Nm3WHSDVXgtwjz5Rf8ueW3SAClwhWyJtWCNjnMSpJ IsD7+vKo2TSwyOEmmc648uHaWVplOMl5qvnbAeYVBChXMJ90B5beXFEc4dNmioN+RU4w tw5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=kmBbNpOi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si3991717pgn.123.2021.10.14.07.36.56; Thu, 14 Oct 2021 07:37:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=kmBbNpOi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbhJNO0j (ORCPT + 99 others); Thu, 14 Oct 2021 10:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhJNO0i (ORCPT ); Thu, 14 Oct 2021 10:26:38 -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 44C91C061570 for ; Thu, 14 Oct 2021 07:24:33 -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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XeOyDQkq1uPXVeW24zX/26vNnS1ATHn1F0LAI5O9ioA=; b=kmBbNpOiO5do7yv3mmUvroGyby IgF2SKwEPtcfhKy7XK74HN3tbEvzNvDvttdEDRqNiaDCUsu7rfIIa88KMkq2Oc/5cG5mRipJT+aBT w2isuO2YltnZb3m6Fa4vkUFEbi3PUZ+7icaMa5t9t+CwrQnEmWhZGf/o5egMw72m5uVpamWIX6+wT djrdrqimAHBB/5QECgOc2lbWHmaTZ419vINmcfaNEViN2fPG8BD0u5JWFNQjCBsfA+W8ndJi6Xu94 1cQnQwfjUs1+kJkDVlca6gqeIo65idlH6zC1Yf8ufjG1LzbcB7U1+tJOO9TG7/Vlq5SUZ2UaMVOV1 EKAs/xvA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mb1eZ-009qfL-65; Thu, 14 Oct 2021 14:24:15 +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 (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B48423001E1; Thu, 14 Oct 2021 16:24:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 863602CE91EE8; Thu, 14 Oct 2021 16:24:13 +0200 (CEST) Date: Thu, 14 Oct 2021 16:24:13 +0200 From: Peter Zijlstra To: Josh Don Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Joel Fernandes , Vineeth Pillai , Hao Luo , linux-kernel Subject: Re: [PATCH] sched/core: forced idle accounting Message-ID: References: <20211008000825.1364224-1-joshdon@google.com> <20211009155435.GW174703@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12, 2021 at 12:45:28PM -0700, Josh Don wrote: > On Tue, Oct 12, 2021 at 5:27 AM Peter Zijlstra wrote: > > > We scale by the number of cpus actually forced idle, since we don't > > > want to falsely over or under charge forced idle time (defined > > > strictly as time where we have a runnable task but idle the cpu). The > > > more important scaling here though is the division over the number of > > > running entities. This is done so that the aggregate amount of forced > > > idle over some group of threads makes sense. Ie if we have a cpu with > > > SMT8, and a group of 7 threads sharing a cookie, we don't want to > > > accrue 7 units of forced idle time per unit time while the 8th SMT is > > > forced idle. > > > > So why not simply compute the strict per-cpu force-idle time and let > > userspace sort out the rest? > > Do you mean to compute force idle solely as a per-cpu value? I think > that would be fine in addition to the per-thread field, but a > desirable property here is proper attribution to the cause of the > force idle. That lets system management understand which jobs are the > most antagonistic from a coresched perspective, and is a signal > (albeit noisy, due to system state and load balancing decisions) for > scaling their capacity requirements. Urgh, reading is hard. I hadn't noticed you did per-task accounting (and the original changelog doesn't clarify this either). Also, should all this be undef SCHED_DEBUG ? Or be part of SCHEDSTATS ?