Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2455019iob; Fri, 20 May 2022 09:41:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJXpeV8/9vCKvRphGwrMFYIWPf41ZiPeY+FVm/NDi76CfVok8iXP51eoU9MdBPFVXshauM X-Received: by 2002:a63:798c:0:b0:3db:7719:59d3 with SMTP id u134-20020a63798c000000b003db771959d3mr9195296pgc.303.1653064911399; Fri, 20 May 2022 09:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653064911; cv=none; d=google.com; s=arc-20160816; b=kSRafsthYWusCSwd8j+G4o2/3FJa+3kDtyFdN1jOXDkzcuVhzpoC1I0Di8QaspTAdp VU0YQDraYypdOcfo/C81xSVpmpLGcsNqgsddbf2lyk/P1ierOVt4XvueST22ANDdtMrG 1l4rf3FN/ihOLUp5hWE87NnuH5RbetIQDDvmDcyHOc0fLgAvYT6gCDddwls2KsudCCyW ioUbERh4Ma5/B0EsmefvblYTuPTMfmn/HCBlKx7evnNV01v3KjYHrAG/6tnYk3/7JW6r PD/4yVUW6sZ4yTe93Ghf3EGFckw4YASFs4Xgigs3piG4mZIs+Km3aATO/X+YcY5CkKGZ Upuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vpmZe7NIgncmC9N5Bspzg+Tuz94sgQYIdXmKL335178=; b=b2sWpd3QJdufM1C2s+eXew23yYyBw1+7DPzDhmMFRBt5dH6nAVJ/tzJ7E936qcB+pi CuFpC51Sn5XP81+abOxOmS2e5kiRmfn6c998p9NYzBC2xmRB4EV9ay2zlzrMswwlY73S MRlvRqkOAaEbGs1vLo6o3AyXTVL6R7y1N+Tco8mgjP0+gjRpXcwaoLXCytTNUbTT9suH CTN15D+al7H/K7ArTzZueXjHumPdisU8DJTGu60nz1jeJlQwKdw889L3vb0ogZo/sO74 DKdXajHnozhDAl0Qv/fQNYFI748rSJFD4V5F1cTsTvsb1aTcZgOUagQo6srvzwmhpeO8 2hMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UbSfSf+c; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a056a00240900b0050fea04c5fbsi1050122pfh.42.2022.05.20.09.41.39; Fri, 20 May 2022 09:41:51 -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; dkim=pass header.i=@linaro.org header.s=google header.b=UbSfSf+c; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239313AbiESN65 (ORCPT + 99 others); Thu, 19 May 2022 09:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233431AbiESN5O (ORCPT ); Thu, 19 May 2022 09:57:14 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCAA8640B for ; Thu, 19 May 2022 06:57:13 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id e78so9146664ybc.12 for ; Thu, 19 May 2022 06:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vpmZe7NIgncmC9N5Bspzg+Tuz94sgQYIdXmKL335178=; b=UbSfSf+cHrp/fqAvzlPIukmPsm2yZAiAzIvOVpTFC1ax3EpfwM1oh2wSpg5QJu7J+Y +US+5PV3p2w9Lt8IAyCkyB+vJ1f9TEabZ/o5Eu7XXSGc6bIhdMuC2rN41u2oiPxLz+Tu X5owoj7sKN/7wfWrDQBfAjjE91h7IGUOjXI696QUHeq71PBqcs16laABCuc8Dk8lapzI 4+Xa85Pq9uTRnmi1acqFRRvz3RD0u7r4iTF6wXwyExMv12q+uBI1TVfFg6Ulbq9KVvFv e16jAR3SS+79E//ssCktVATQTCm34b3vG7KwTwc272AxyHogy3MNyKODAiaZOafDsOzP sI4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vpmZe7NIgncmC9N5Bspzg+Tuz94sgQYIdXmKL335178=; b=dRQz6J4cMC08P9tCUMa9/yNg81gwN/oP8vj9Dl1sPC34oBdqleYNDeOfWwVMggAwNN LDjruNVj+YM8nrz0tTS3RsoNu1aTmDUKuN6+dhkGy47AsXPXEFhm9cthl/lUJSMyrXmF F5jBZN+Nj8M6Lv3ziONfuPXJ+mPS6mt8D8e9rCzFwzoR839UcMtROlXKH3qoT8QcDznw jALg6nbG9dG4/xmZhJOjheavfrRIv6YJeK4bivGSKEkHW6MM6H6noQFpK+rnfh9lGh+x 6nVR8WbJeycM1PTJn4k7nlHd9yRiUHuqH+f/wLe5lSuvqgZGjvps6wf2gT2eKymJWmVU wCsw== X-Gm-Message-State: AOAM531Z2PjKW1lprMO9YohaoGQW81vecq7TUkUH6HMFmd6cA+m7W3YV 3a/OJ1MmsX11pULa7XupmENFu2eWR6uId3SxJCB5gQ== X-Received: by 2002:a25:5909:0:b0:64d:f503:33c8 with SMTP id n9-20020a255909000000b0064df50333c8mr4443107ybb.241.1652968633018; Thu, 19 May 2022 06:57:13 -0700 (PDT) MIME-Version: 1.0 References: <20220512163534.2572-1-vincent.guittot@linaro.org> <20220512163534.2572-6-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Thu, 19 May 2022 15:55:25 +0200 Message-ID: Subject: Re: [PATCH v2 5/7] sched/fair: Take into account latency nice at wakeup To: Josh Don Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel , parth@linux.ibm.com, Qais Yousef , "Hyser,Chris" , Valentin Schneider , patrick.bellasi@matbug.net, David.Laight@aculab.com, Paul Turner , pavel@ucw.cz, Tejun Heo , Quentin Perret , Tim Chen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, 17 May 2022 at 02:54, Josh Don wrote: > > Hi Vincent, > > On Thu, May 12, 2022 at 9:36 AM Vincent Guittot > wrote: > > > > Take into account the nice latency priority of a thread when deciding to > > preempt the current running thread. We don't want to provide more CPU > > bandwidth to a thread but reorder the scheduling to run latency sensitive > > task first whenever possible. > > > > As long as a thread didn't use its bandwidth, it will be able to preempt > > the current thread. > > > > At the opposite, a thread with a low latency priority will preempt current > > thread at wakeup only to keep fair CPU bandwidth sharing. Otherwise it will > > wait for the tick to get its sched slice. > > Following up from the discussion on the prior series, I'm still not > sure why this approach is exclusive of extending the entity placement > code; I think both changes together would be useful. > > By only changing the wakeup preemption decision, you're only > guaranteeing that the latency-sensitive thing on cpu won't be > preempted until the next sched tick, which can occur at any time > offset from the wakeup, from 0ns to the length of one tick. If a In fact, you are ensured to run a minimum time of 3ms at least on >=8 cores system before tick can preempt you. I considered updating this part as well to increase the value for negative weight but didn't do it for now. I can have a look > latency-tolerant task wakes up with a lot of sleeper credit, it would > pretty quickly preempt a latency-sensitive task on-cpu, even if it > doesn't initially do so due to the above changes to wakeup preemption. > > Adjusting place_entity wouldn't impact cpu bandwidth in steady-state > competition between threads of different latency prio, it would only > impact slightly at wakeup, in a similar but more consistent manner to > the changes above to wakeup_preempt_entity (ie. a task that is not > latency sensitive might have to wait a few ticks to preempt a latency > sensitive task, even if it was recently sleeping for a while).