Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1116490rwb; Thu, 22 Sep 2022 10:16:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6m0MBZDqCpaNIpnjxg4B4PIVCCxy5wjzoYWZqkZ0pybKmiLx2KuVS9s5tsdWm2AgslndZm X-Received: by 2002:a17:90b:1d8a:b0:203:6db:ed6f with SMTP id pf10-20020a17090b1d8a00b0020306dbed6fmr4868346pjb.228.1663866995327; Thu, 22 Sep 2022 10:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663866995; cv=none; d=google.com; s=arc-20160816; b=y9813fe8ktmMF5I68XKLOGamkCwg19fV5+irVlRIzl+8MXc4eBZ1YQjrG9BddPBnql h/gz6cDgUm7zf0w1SV7iurl8+5j+ukeZlAnMZisRmMigozeN/XmvnGthQNicjknDF0s/ ZqviQ0cvJnH/HTsza5DSoVuZO45NBi1E44G+yBUOcIS0bejVHE57iJOCnKcunNLV6yyd kbzffgFAyFAkBRcYVu7f6c9PrldR6kthD4joVCrZpoJ6E+DqtfWuU3v0EtdENU+pMPQ7 JDe5s5OVyPLCKYJ8cEuCoYltz8AERo3ivoAF35sInAgVTfIHrZaNsDNS21AGpRznwTsa AoQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=vBzKxri45UmpvbghQiILwufPn5tYxmkV4gFdf2QxpPo=; b=e+bXCjigmd0ANBmlE0fS5YFExkhBfCicV3YANnj85wHSTgqua3rcEDo/R32D+BVHej 4dtw6nVhOgg5xYW+2r7iFMwPet1gC3z/hiJZ0A0ckZX1D3f/tNPNvpxp2Udhftks8vKH mXf6DY6p3c1NrBsc3E+zzlW0IQKvcdczCosZjltEfO8Ha6PsONuI5hFn7pm7tfxHlG/z HQWJUXIs9PzAC/bMOwinBI4BXCGK966lbJWZWNeGt5RSRjMjbuKeV84sesqpPxdDx0BH 56EmSBiniqyg5KPH6lxxUEl2M1rH5+QLbWfiqqc8T5A3HagnehRYt6UCYVIPwTJx+WQ1 AQfQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a63d752000000b0042b59c58ab1si6480275pgi.498.2022.09.22.10.16.23; Thu, 22 Sep 2022 10:16:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231185AbiIVQub (ORCPT + 99 others); Thu, 22 Sep 2022 12:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbiIVQu2 (ORCPT ); Thu, 22 Sep 2022 12:50:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD7C0B5A5E for ; Thu, 22 Sep 2022 09:50:27 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DC9416F8; Thu, 22 Sep 2022 09:50:33 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD58A3F5A1; Thu, 22 Sep 2022 09:50:23 -0700 (PDT) Message-ID: <0a437c9e-299d-574e-a393-f589c78ba2c7@arm.com> Date: Thu, 22 Sep 2022 18:50:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v4 5/8] sched/fair: Take into account latency priority at wakeup Content-Language: en-US To: Vincent Guittot Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, parth@linux.ibm.com, qais.yousef@arm.com, chris.hyser@oracle.com, valentin.schneider@arm.com, patrick.bellasi@matbug.net, David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz, tj@kernel.org, qperret@google.com, tim.c.chen@linux.intel.com, joshdon@google.com References: <20220916080305.29574-1-vincent.guittot@linaro.org> <20220916080305.29574-6-vincent.guittot@linaro.org> <073938c4-ab23-2270-8e60-291f2901e230@arm.com> <04c65f4f-5072-2a07-cbe0-63046a7bc58f@arm.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 22/09/2022 09:12, Vincent Guittot wrote: > On Thu, 22 Sept 2022 at 00:41, Dietmar Eggemann > wrote: >> >> On 20/09/2022 17:49, Vincent Guittot wrote: >>> On Tue, 20 Sept 2022 at 15:18, Dietmar Eggemann >>> wrote: >>>> >>>> On 19/09/2022 17:39, Vincent Guittot wrote: >>>>> On Mon, 19 Sept 2022 at 12:05, Dietmar Eggemann >>>>> wrote: >>>>>> >>>>>> On 16/09/2022 10:03, Vincent Guittot wrote: [...] > I thought you were speaking about priority 0 vs [1..19] as you made a > difference in your previous comment below > >> >> (1) p = 10 curr = 19 -> wakeup_latency_gran() returns 12ms >> >> (2) p = 10 curr = -10 -> wakeup_latency_gran() returns 24ms >> >> In (1) only p's own latency counts whereas in (2) we take the diff, > > Yes because curr is latency sensitive in (2) whereas it's not in (1) > >> >> In (A) we 'punish' p even though it competes against curr which has an >> even lower latency requirement than p, > > What is (A) ? Assuming you meant (1), having a positive nice latency Sorry, yes I meant (1). > means that you don't have latency requirement but you are tolerant to > scheduling delay so we don't 'punish' p. P will preempt curr is we are > above the tolerance wakeup_preempt_entity() { vdiff = curr->vruntime - se->vruntime vdiff -= wakeup_latency_gran(curr, se) <-- (3) if (vdiff <= 0) return -1; ... } Wouldn't it be more suitable to return 0 from wakeup_latency_gran() if both have latency_nice >=0 in this case instead of se->latency_offset? By `punish` I mean that vdiff (3) gets smaller in case we return (the positive) `se->latency_offset` even `latency nice of curr` > `latency nice of p`. [...] >> With p = -19 and curr = -19 we would take the diff, so 0ms. >> >> With p = 19 and curr = 19, if we would use `latency_offset -= >> curr->latency_offset` wakeup_latency_gran() would return 973/1024*24ms - >> 973/1024*24ms = 0ms and nothing will shift. >> >> OTHA, in case (1) wakeup_latency_gran() would return 512/1024*24ms - >> 973/1024*24ms = - 10.80ms. So p would gain an advantage here instead of >> a penalty. > > And that's all the point. A priority >= 0 means that you don't care > about scheduling delays so there is no reason to be more aggressive > with a task that is also latency tolerant. We only have to ensure that > the delay stays in the acceptable range OK, I understand you model here but I'm still not convinced. Might be interesting to hear what others think.