Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2270801rwb; Mon, 7 Nov 2022 11:11:47 -0800 (PST) X-Google-Smtp-Source: AMsMyM5FPJYpAwczr60r2MaISq9430VDtHVIx6jM+1ohsRS9yDFG/VnvGfAupEANq551UQAx1Mvd X-Received: by 2002:a62:4e50:0:b0:56b:d5e8:335e with SMTP id c77-20020a624e50000000b0056bd5e8335emr50984711pfb.61.1667848307347; Mon, 07 Nov 2022 11:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667848307; cv=none; d=google.com; s=arc-20160816; b=xU66q/AjHoUatdWCAXetZUNvQDUK3podh3kuewIsm6wKE/uaiHuH5nITNO169WuNBR 6EHbokDMGda+2G1++yXXSawb+jZvSIA3dqAXD39+Qu4swvhqu9L0OtSfb+lJ2T/3HcmH JDwODxXUVObnQbPoSFHBXQW5cmnGhRP6Cd6yp1MZQ678+oXO9WxprO3cim7panYWG4od 30CkRWQFEYY9K4Xk1h/TgbXB0sKbTWDYLF/d2JZL1IFew60gplImi7wflwArlr2A2SLK GF55XPsBhVTOijlUzZLK4cAgEkJszJkZcfYZ5BxdoMgUY31r60rsRZkc3JZIryORnzKg Nd1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Lm/gLWjRRDByRItdq2DWUDLAYXSuDRiPzJ+nYmQMRws=; b=T11zLB684Umz7QtaTHQgYH/cCeSqowC0MHPNtU1ff7q54Ctwx2Uqu5RegCaO41S5dA RHnVp0MlFaR3YMEg4vw9bjx4eHZ+jPTsY3LRtKblSxf9QpGfE8UUp72AvJ8JrU/adGXe EpJdLCaS/Tny50pqkLOXE0WsmJHYm+qrCdu21l5tiFIVJqOSQIgnbPRzEaurGj+JTcVB aGH0npTtGD0P4UVcbUyjSXWN1dPs8R0Ys4gTycfhOmalYK36GKnHupci+Ci1tizdYNo/ IUzAmmBTWxUl+nZizEmxeyLOIvF1LqHbWoahcf2V/1fb8GqUj1KNTeFG8guuur5wJbg3 tgtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TqJPn4Zn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m134-20020a633f8c000000b0046f5f002364si12129011pga.715.2022.11.07.11.11.35; Mon, 07 Nov 2022 11:11:47 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=TqJPn4Zn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231734AbiKGS7O (ORCPT + 92 others); Mon, 7 Nov 2022 13:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231970AbiKGS7M (ORCPT ); Mon, 7 Nov 2022 13:59:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96EA424953 for ; Mon, 7 Nov 2022 10:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667847497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Lm/gLWjRRDByRItdq2DWUDLAYXSuDRiPzJ+nYmQMRws=; b=TqJPn4ZndOWNh0XrQrqMH1MhDXIESbznYZLUPwLyegABKYZtnE3RlMCBIHu8dnM2+I37ti hdtIHdC9oCR6FgVYqlilB5XG/l98MMjl5BaXamANjwyrhAdMMA6kvkHrkrXsqyi+RdPsV5 p+fxzPS7ZWHnG52TbgOXueDUo16c+IU= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-205-1eVoQbZ8M_-T68ImQ5k3ug-1; Mon, 07 Nov 2022 13:58:15 -0500 X-MC-Unique: 1eVoQbZ8M_-T68ImQ5k3ug-1 Received: by mail-wr1-f69.google.com with SMTP id d10-20020adfa34a000000b00236616a168bso3136031wrb.18 for ; Mon, 07 Nov 2022 10:58:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lm/gLWjRRDByRItdq2DWUDLAYXSuDRiPzJ+nYmQMRws=; b=izSaNO7UowQZxPF+d821sl/Vgu+2QLWTrfQZbaTxZkOi6Ioba/ZpqXSHMwef2F2sO9 z0At5oYYs9yI13uZrwE8sbOv+3FUXsoccKHRN6goVov/dT/pAz/gZ7XlsTFPVFVv1xTP KHqSGoxue07AhK7egtMhV5YyjOfq+unhrRkLv7OPHvXSHgMN5qaxZ+eWAIjGRJPj2aCE K4oq9ucic91mGs9hqIaRDxPbaoHWTqMvGSie7oZei+kFHAAQA3/MG4TXmQVutQsdXeK6 ZPw3nLpxr7UvPRPMeA9znYeCZ9lcI7h2sRrrMz6KQvW/Y78AHTyUqIod3uKSrEi6SjPM OCew== X-Gm-Message-State: ACrzQf1bQ+H+nW9LVEyfC2o9S3A7o5ocjcr32awhfUo17XYJlDyRw3mc 0AI+Hw7DSG85RscGj8vgZ2pGYydZJSfhUOAzkVCrzHUCBMv1jhzJLs5dbTlDyU/4yyDW4Y0LYEJ 3LUONILRLP96g9EPRSFpHHYVu X-Received: by 2002:a05:6000:11cb:b0:236:b1ad:7ae7 with SMTP id i11-20020a05600011cb00b00236b1ad7ae7mr31039386wrx.608.1667847494414; Mon, 07 Nov 2022 10:58:14 -0800 (PST) X-Received: by 2002:a05:6000:11cb:b0:236:b1ad:7ae7 with SMTP id i11-20020a05600011cb00b00236b1ad7ae7mr31039372wrx.608.1667847494180; Mon, 07 Nov 2022 10:58:14 -0800 (PST) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id v2-20020a7bcb42000000b003cf4ec90938sm8931819wmj.21.2022.11.07.10.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 10:58:13 -0800 (PST) From: Valentin Schneider To: Qais Yousef Cc: Qais Yousef , Ingo Molnar , "Peter Zijlstra (Intel)" , Vincent Guittot , Dietmar Eggemann , linux-kernel@vger.kernel.org, Xuewen Yan , Lukasz Luba , Wei Wang , Jonathan JMChen , Hank Subject: Re: [PATCH v2 1/9] sched/uclamp: Fix relationship between uclamp and migration margin In-Reply-To: <20221105192452.e6lgq55uyiij7ecf@airbuntu> References: <20220804143609.515789-1-qais.yousef@arm.com> <20220804143609.515789-2-qais.yousef@arm.com> <20221105192452.e6lgq55uyiij7ecf@airbuntu> Date: Mon, 07 Nov 2022 18:58:12 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 05/11/22 19:24, Qais Yousef wrote: > On 11/04/22 17:35, Valentin Schneider wrote: > >> > + /* >> > + * We must use capacity_orig_of() for comparing against uclamp_min and >> > + * uclamp_max. We only care about capacity pressure (by using >> > + * capacity_of()) for comparing against the real util. >> > + * >> > + * If a task is boosted to 1024 for example, we don't want a tiny >> > + * pressure to skew the check whether it fits a CPU or not. >> > + * >> > + * Similarly if a task is capped to capacity_orig_of(little_cpu), it >> > + * should fit a little cpu even if there's some pressure. >> > + * >> > + * Only exception is for thermal pressure since it has a direct impact >> > + * on available OPP of the system. >> > + * >> > + * We honour it for uclamp_min only as a drop in performance level >> > + * could result in not getting the requested minimum performance level. >> > + * >> >> Why specifically care about OPPs here? Per our CPU capacity model, a task >> alone on a CPUx throttled to f=fmax/2 and a task coscheduled on a CPUy with >> RT/DL tasks and/or IRQs such that cpu_capacity(CPUy) = 50% are both getting >> (roughly) the same performance level. > > Depends how you define performance level. What you call performance level, > I think is better called bandwidth. Uclamp is a performance and not a bandwidth > hint. > > If a 10% task: > > p->util_avg = 10% * 1024 > > is requesting max performance level > > p->uclamp_min = 1024 > > This will translate to running at highest frequency and in case of big.LITTLE > system, the biggest CPU too. > > RT/DL pressure has no impact in the task being able to achieve this; that is > running at max frequency and biggest cpu. > > If the cpu has no bandwidth to fit this task, then our usual comparison of > util_avg with capacity_of() should fail as usual. > Ok so we *do* have this with how the fitting criteria are combined (I didn't get that when I first scanned through the code); thanks for elaborating on that. > In the example above, the RT/DL pressure has to be pretty high for the 10% task > not to fit from bandwidth point of view. Which has nothing to do with > uclamp_min. Only thermal pressure which drops OPPs can actually affect the > uclamp_min hint/request. > > That is, when the task runs it will run at maximum frequency regardless of the > RT/DL pressure. The fact that the bandwidth of the CPU can be stolen has > nothing to do with uclamp_min hint. > > > Thanks! > > -- > Qais Yousef