Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4445928pxj; Tue, 25 May 2021 08:11:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxbc4/grUgTclnuPxj7SIRP0rG07uGft9tm0pqn0/OLpWBKYMxLehKwrbmjtb6hqHfnhQd X-Received: by 2002:a5d:9a97:: with SMTP id c23mr21725573iom.38.1621955479547; Tue, 25 May 2021 08:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621955479; cv=none; d=google.com; s=arc-20160816; b=WbgkAxRmsCoCk6GcXzhTFt63DqOBRHtJLL5pdH6De9bjVVG7F0ZtkaxZxk/B/t/lkL ZUmzaCUTWEvg9NivWy1QuhpNyIIZiAtLB1OellWbeaEkuvVCCVCu5DsPQTZQy8YWRZdF +GFVZVwlXfqmiIy5AsH9KEqOTvrdlaIXMtRnHC3+veJG1Swg6MPv0GLD75frkRR3D6oS 0v16gKUDyf0t6VekbPDSLRxDs47cpZ9oBg/L83LAUAbrOgFvJSV3lvAhXH/Ccul7F1UU rd676/GE5cuWeQ68O2USaHCnk6SjmcQQlgLWWPv2fs0cMZ+0t0dvRMgg4RCp55LrJZDK Ob4A== 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=kIlqXG4mzpF8kuUvhtnEEvK4Ewcs8NIwl3xb4LOQl/8=; b=MCLSJTrMiSD88pTDC5fyuxFFLiOwGVpJGHTonKE2KD5/89inY+1+jmSw1hGYA9C/fT 8vgUCV7qldoa1wkWDDfzQieLh6FuR0Ej7U1bYf2ttptSpBKg9x7FmDvzPLH7yS3d9xom Bi5cfhkRa+cXQ5+eppMxbeMR1/a9k8j0wiyIQXRdu4xjhcIN4o+r6n2Gdblbl9rbJJow tXbRPhfxU1o9UyXPqsiErUBfww5Gcm0cqHFBTQ6LufK+wxjHUG6zYcN9I+wEl72gnQGH /+2IKHkG58IQoJXuw0JVFF05JyseuVJYpV9RnmR88V3CBfx+7R2BMNTz7x86o4DMhEtj DVgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EGdqySZJ; 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 p8si16413383ils.114.2021.05.25.08.11.05; Tue, 25 May 2021 08:11:19 -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=EGdqySZJ; 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 S230380AbhEYKtV (ORCPT + 99 others); Tue, 25 May 2021 06:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbhEYKtU (ORCPT ); Tue, 25 May 2021 06:49:20 -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 CBED2C061756 for ; Tue, 25 May 2021 03:47:50 -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=kIlqXG4mzpF8kuUvhtnEEvK4Ewcs8NIwl3xb4LOQl/8=; b=EGdqySZJVv63v+zSdlDGsWVXtd DFWrJNTl1FEo9YrOiO+HGX90X5nWvoe8PMhgAClHFoZKGUsI4H0qwTf8d3n6hMVRutRgztmX/fuKg lxrjAocet7/4KPqBq33GS0fBItr8ysvhvpA4ZFPoyp067wHGvo1Np5Dybgbd0qdTxTE3Ag8mkCtLh dAxHDmDLC0FGzEEbLxuZCkpVaJiQErZlKv95ZuVXO7ybWfidhG9zqQT0fCysyNceNoMQc9gSMRz4T LWhtq4x45FfFUWlcd/71wWFrFmqRFVgk1nIz8n1N97C0HksTeRIBnUD5CfDflb4gRZlgRbcnLKa8D mYBkOsUw==; 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 1llUaj-0002Hn-4L; Tue, 25 May 2021 10:47:24 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7E5D53001E4; Tue, 25 May 2021 12:47:23 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6B15220299B4D; Tue, 25 May 2021 12:47:23 +0200 (CEST) Date: Tue, 25 May 2021 12:47:23 +0200 From: Peter Zijlstra To: changhuaixin Cc: Benjamin Segall , Dietmar Eggemann , dtcccc@linux.alibaba.com, Juri Lelli , khlebnikov@yandex-team.ru, open list , Mel Gorman , Ingo Molnar , Odin Ugedal , Odin Ugedal , pauld@redhead.com, Paul Turner , Steven Rostedt , Shanpei Chen , Tejun Heo , Vincent Guittot , xiyou.wangcong@gmail.com Subject: Re: [PATCH v5 1/3] sched/fair: Introduce the burstable CFS controller Message-ID: References: <20210520123419.8039-1-changhuaixin@linux.alibaba.com> <20210520123419.8039-2-changhuaixin@linux.alibaba.com> 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 Mon, May 24, 2021 at 08:42:03PM +0800, changhuaixin wrote: > >> static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg) > >> @@ -4651,6 +4666,9 @@ static int __assign_cfs_rq_runtime(struct cfs_bandwidth *cfs_b, > >> if (cfs_b->quota == RUNTIME_INF) > >> amount = min_amount; > >> else { > >> + if (!cfs_b->period_active) > >> + __refill_cfs_bandwidth_runtime(cfs_b); > > > > Why this call? > > As the cfs bandwidth timer stops on idle with runtime unfilled, refill runtime when it restarts to make > use of the underrun when period timer stops. Another way to do this might be: > > throttled = !list_empty(&cfs_b->throttled_cfs_rq); > cfs_b->nr_periods += overrun; > > + __refill_cfs_bandwidth_runtime(cfs_b); > + > /* > * idle depends on !throttled (for the case of a large deficit), and if > * we're going inactive then everything else can be deferred > */ > if (cfs_b->idle && !throttled) > goto out_deactivate; > > - __refill_cfs_bandwidth_runtime(cfs_b); > - > if (!throttled) { > Ben, do you have a preference?