Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1357101ybh; Thu, 16 Jul 2020 09:52:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1XrEF6GsxLhUK33gS5E0zLU39WkhOQ/ZphSQDwpzHwinT3cPKrsP2XjdCT9Me045DCLPF X-Received: by 2002:a17:906:6406:: with SMTP id d6mr4441909ejm.30.1594918328005; Thu, 16 Jul 2020 09:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594918327; cv=none; d=google.com; s=arc-20160816; b=uTTR391yua1lBcbK8j8LPtYWN+JkMB4FYLcsJmmezfXUSRfH9p+1GiOAM8fIZp/iGF BoGbr5NwUt2ScHzeQY7v9dAlZD6NJMc+/hX/My2euncDkvqprRJGtVaeIawfNN6Id83R /In78COYzKlTax1brswLTPNCNe90CBdF63Hlk0qH9cfCrQ6vCjwei7yQ5l3+U2wwYA/B uwSmDukXC6PyYTXk1OMP/fS6SDpvc8UJxZlyBhMyej9quZBS0ZU01cdk0vjz2PmKLVdv 8ZUjS5VpwzP7rCuuAEPECQ9EfO2ogPJrTcN+e6R08yIcAu1xkWlOXG3e7CyZHJoyvdMY 32+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=p4AcCqwDmzi0RERGIvBEuGQVJNoWgeqiAbhOEoj74ps=; b=hlw3+oHyLPXO6c9zXrFeke32LskcSiDstqnm6G07XR0lF//tTgNVk9NPXg+TdUunGr FMWQbE2WQo18I12uxFmsa2XJBcdMbGqdoyzXSm4+LHhiOXj4B4UauATJJuWcN5io5S3Q CXtJjLkwfwgCQ2VdRXacP1aDCQn6ksS2cD9H8uXCbIvEhu36/XXO/J59vs7abxWiwwH0 xsnh/FLRvvDCzbVr67k7+Ylxm7O22uC24KEcgLtyQFaufCpHkaX6g1wFcRVrzFZhUYsb tFfhA9hl3jNQDNnUFVE0RU3q/o8/R+VB3lEPtLThgTVmAztTODtxWRix+BqxeuvwPD9Q sbeg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo26si3519736ejb.154.2020.07.16.09.51.45; Thu, 16 Jul 2020 09:52:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgGPQs4 (ORCPT + 99 others); Thu, 16 Jul 2020 12:48:56 -0400 Received: from foss.arm.com ([217.140.110.172]:47596 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgGPQs4 (ORCPT ); Thu, 16 Jul 2020 12:48:56 -0400 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 83F9630E; Thu, 16 Jul 2020 09:48:55 -0700 (PDT) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A5EC3F68F; Thu, 16 Jul 2020 09:48:53 -0700 (PDT) Subject: Re: [SchedulerWakeupLatency] Per-task vruntime wakeup bonus To: Vincent Guittot , Patrick Bellasi Cc: LKML , Ingo Molnar , "Peter Zijlstra (Intel)" , Juri Lelli , Paul Turner , Ben Segall , Thomas Gleixner , Jonathan Corbet , Dhaval Giani , Josef Bacik , Chris Hyser , Parth Shah References: <87v9kv2545.derkling@matbug.com> <87h7wd15v2.derkling@matbug.net> <87imgrlrqi.derkling@matbug.net> <87mu5sqwkt.derkling@matbug.net> <87eer42clt.derkling@matbug.net> <87imfi2qbk.derkling@matbug.net> <87blla2pdt.derkling@matbug.net> <878sfrywd8.derkling@matbug.net> From: Dietmar Eggemann Message-ID: <46c7f966-6679-bb9e-dabe-bb385298d19b@arm.com> Date: Thu, 16 Jul 2020 18:48:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/07/2020 14:59, Vincent Guittot wrote: > On Fri, 10 Jul 2020 at 21:59, Patrick Bellasi > wrote: >> >> >> On Fri, Jul 10, 2020 at 15:21:48 +0200, Vincent Guittot wrote... [...] >>> Instead, it should weight the decision in wakeup_preempt_entity() and >>> wakeup_gran() >> >> In those functions we already take the task prio into consideration >> (ref details at the end of this message). >> >> Lower nice value tasks have more chances to preempt current since they >> will have a smaller wakeup_gran, indeed: > > yes, and this is there to ensure a fair distribution of running time > and prevent a task to increase significantly its vruntime compare to > others > > -1 min that se already got more runtime than current > 0 that se's vruntime will go above current's vruntime after a runtime > duration of sched_min_granularity > and 1 means that se got less runtime than current and its vruntime > will still be lower than current ones even after a runtime duration of > sched_min_granularity > > IMHO, latency_nice should impact the decision only for case 0 but not > the case -1 and 1. > That being said, we can extend the case 0 a bit to include the > situation where current's vruntime will become greater than se's > vruntimes after a runtime duration of sched_min_granularity like > below: > > curr->vruntime > |<-- wakeup_gran(se) -->|<-- > wakeupgran(curr) -->| > current range: se->vruntime +1 | 0 | -1 > new range: se->vruntime +1 | 0 > | -1 > I assume this got messed up by line break somehow: curr->vruntime |<-- wakeup_gran(se) -->|<-- wakeup_gran(curr) -->| current range: se->vruntime +1 | 0 | -1 new range: se->vruntime +1 | 0 | -1 IMHO, with the current use of wakeup_preempt_entity() I don't see what will change with that. We check 'wakeup_preempt_entity() == 1' in check_preempt_wakeup() and 'wakeup_preempt_entity() < 1' in pick_next_entity(). How should the mapping between se's latency_nice value to the consideration of wakeup_gran(curr) look like? [...]