Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2319533pxb; Mon, 19 Apr 2021 02:54:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCTuWhiDKXpeSa+U6elC5+MFXw6P0dLHw2k6/Oa9iPysCjx4HZjhz54NDVx+NJkSoTGiD8 X-Received: by 2002:a17:902:e8d1:b029:ec:824a:404e with SMTP id v17-20020a170902e8d1b02900ec824a404emr14173106plg.61.1618826097408; Mon, 19 Apr 2021 02:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618826097; cv=none; d=google.com; s=arc-20160816; b=y+UyQrglGGmeSnfkROOKOh2jrjr6bg++zxmjPn6p/7OaE+Kw6dhTup6bCC61pgCcTE 9oi85SfxNG3vyJRX9+fsO7qwZ7Dj+5VKJRBAMQFmztPZDQm6JoMb/RwDaJxg1fXHqq0T I3jQFDH1bI7nl0xJhYuEjh18LHRwSOjhTNWX50z8tXke9KTubAygTAmV6TGRf5FxeQ7k Grl07IFw995t8QixGSRgwcM4cEJ6pFYSWcu4GqokR1w8JhgmggeYcJPZDN3Z3qG9FDqa f17Yp14mMW6tAW7I/UADT0HQyW7dqafzX9hplbnwxcjUL1aZ/ciunV2ISOCymC8V6pj3 DpOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=RdRIbJRytNCup7y+xOOI5Z6hNGaBkuazD3X6men64DE=; b=qeeJnv7nZ5L/rW3iMYpbsqwdLfG9M5P/2nULIRTffir2MkCpLvhj1LaPiQ9WnX4P89 rvas99Bj1qfhcZDOLjV60tadA+ARsXrCP1+LIbNZYTkCZYwLj0El9vwO7JX4I+PY9F5R llt0BUPjVnKuiA4sZmdZMD7TZG/blcWPJ/oU7YLdwQp70kTe0BT1Gy3ceq7YLJVqLvWd qD+f5gL1ywTJ1CFbIr1Ja6EP9PhiIcGr1oXUWiLl59gns0WykwI2C5fp1jZ76SrBZTU2 yKuy7aoI/4i2KFdHG/gVylUzNqv1HTDk0rvVipU3NMcWT1OkBPSTsUft9qje5y23q0Cs B2gw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si15780607plx.67.2021.04.19.02.54.45; Mon, 19 Apr 2021 02:54:57 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbhDSIT3 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Apr 2021 04:19:29 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:47489 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232548AbhDSITZ (ORCPT ); Mon, 19 Apr 2021 04:19:25 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R981e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=changhuaixin@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0UW0pRF7_1618820331; Received: from 30.240.102.54(mailfrom:changhuaixin@linux.alibaba.com fp:SMTPD_---0UW0pRF7_1618820331) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Apr 2021 16:18:52 +0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v4 1/4] sched/fair: Introduce primitives for CFS bandwidth burst From: changhuaixin In-Reply-To: Date: Mon, 19 Apr 2021 16:18:51 +0800 Cc: changhuaixin , Phil Auld , Benjamin Segall , dietmar.eggemann@arm.com, juri.lelli@redhat.com, khlebnikov@yandex-team.ru, open list , mgorman@suse.de, mingo@redhat.com, Odin Ugedal , Odin Ugedal , Paul Turner , rostedt@goodmis.org, Shanpei Chen , Tejun Heo , Vincent Guittot , xiyou.wangcong@gmail.com Content-Transfer-Encoding: 8BIT Message-Id: <81E6B011-D68E-4E4B-ABBD-CAEAAAFA0470@linux.alibaba.com> References: <20210316044931.39733-1-changhuaixin@linux.alibaba.com> <20210316044931.39733-2-changhuaixin@linux.alibaba.com> To: Peter Zijlstra X-Mailer: Apple Mail (2.3445.104.11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 18, 2021, at 11:10 PM, Peter Zijlstra wrote: > > On Thu, Mar 18, 2021 at 08:59:44AM -0400, Phil Auld wrote: >> I admit to not having followed all the history of this patch set. That >> said, when I see the above I just think your quota is too low for your >> workload. > > This. > >> The burst (mis?)feature seems to be a way to bypass the quota. And it >> sort of assumes cooperative containers that will only burst when they >> need it and then go back to normal. > > Its not entirely unreasonable or unheard of. There's soft realtime > systems that use this to increase the utilization with the trade-off > that you're going to miss deadlines once every so often. > > If you do it right, you can calculate the probabilities. Or usually the > other way around, you calculate the allowed variance/burst given a P > value for making the deadline. > > Input then isn't the WCET for each task, but a runtime distribution as > measured for your workload on your system etc.. > > I used to have papers on this, but I can't seem to find them in a hurry. > Hi, I have done some reading on queueing theory and done some problem definition. Divide real time into discrete periods as cfs_b does. Assume there are m cgroups using CFS Bandwidth Control. During each period, the i-th cgroup demands u_i CPU time, where we assume u_i is under some distribution(exponential, Poisson or else). At the end of a period, if the sum of u_i is under or equal to 100%, we call it an "idle" state. The number of periods between two "idle" states stands for the WCET of tasks during these periods. Originally using quota, it is guaranteed that "idle" state comes at the end of each period. Thus, the WCET is the length of period. When enabling CPU Burst, the sum of u_i may exceed 100%, and the exceeded workload is handled in the following periods. The WCET is the number of periods between two "idle" states. Then, we are going to calculate the probabilities that WCET is longer than a period, and the average WCET when using certain burst under some runtime distribution. Basically, these are based on pervious mails. I am sending this email to see if there is anything wrong on problem definition.