Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6884003ybe; Wed, 18 Sep 2019 10:35:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHEnUc+BMWCrJhYgamqTUbivmJiMVUmjFzt7MXJ3HgJ/ZN5WIXJ8nYp4bkzP5IdGC/8n8f X-Received: by 2002:aa7:d718:: with SMTP id t24mr10556899edq.300.1568828113619; Wed, 18 Sep 2019 10:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568828113; cv=none; d=google.com; s=arc-20160816; b=LN3TVTlLYtuDsd9zmtWq5CVGCQ6os22qdb90Ggc/ygMsxOjgYg5S8Iu2OKFV+xUx0f Jxxv5ZL4qXdh7hzlo8UsV/nL799Pm/C9XIrTwuan9xZ/HJHwLoEY7i/HaRUfyEyw8ZSX XH9lfn9R3HjYGUOH4QQDafF/v8N2Axs+p+0GPviwFBCcaHKn1eXlhXExUtcQtSkDoKoH NMjHm2Nc60CpjxWPqfjij2MX3FRSpgcVYg6xHwmjHmCC7CiKjFDiPqO93uaSURI21wFQ yNvHyLfX71sCvyyV7MtsZWYeIa/KYUdnmeNZv7FJA5TM2tgxSmhlNFROnprKuLNGJMvY /01w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=LebrERTowIXOYoTWCdOEk89r7sSWH2OaEjNiL6rUhsI=; b=oy24VCVlgP4jXW/p/ya4yzIeqkHWrbFStEiRChQKJUTtF/D+ook9K1SYY98m10Jnrv ttiJn/pDkKb+NYv88v4i8MB9YT7YOQtbceaYUN075QBFanNUHvkVTqDcetl9XQa01oCQ gbJh4J6YO7f+twFePRLzHBgirsL18YE71GJXz6tNS66+RwCrdWTWt7pr9gQqEBTObj4+ upM9BvkMXeOBezx8KM/ia5JxHzkb4MvBjKjXv3OOBod3nBYWpo3UxJtxoejyeoop81mz xAMDNC3is0s8qmS9FiMVuFDb2F/fLqIl7k+DSa5OOihqkPoBLT5kFjMEyc7uuZDoL7ii uTQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si3620420edo.14.2019.09.18.10.34.50; Wed, 18 Sep 2019 10:35:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731303AbfIRPqX (ORCPT + 99 others); Wed, 18 Sep 2019 11:46:23 -0400 Received: from foss.arm.com ([217.140.110.172]:44176 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbfIRPqX (ORCPT ); Wed, 18 Sep 2019 11:46:23 -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 B4933337; Wed, 18 Sep 2019 08:46:22 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78B2F3F59C; Wed, 18 Sep 2019 08:46:20 -0700 (PDT) References: <3e5c3f36-b806-5bcc-e666-14dc759a2d7b@linux.ibm.com> <87woe51ydd.fsf@arm.com> User-agent: mu4e 1.3.3; emacs 26.2 From: Patrick Bellasi To: Vincent Guittot Cc: Parth Shah , linux-kernel , Peter Zijlstra , subhra mazumdar , Tim Chen , Valentin Schneider , Ingo Molnar , Morten Rasmussen , Dietmar Eggemann , Paul Turner , Quentin Perret , Dhaval Giani , Daniel Lezcano , Tejun Heo , "Rafael J. Wysocki" , Qais Yousef , Patrick Bellasi Subject: Re: Usecases for the per-task latency-nice attribute In-reply-to: Date: Wed, 18 Sep 2019 16:46:18 +0100 Message-ID: <87v9tp1ub9.fsf@arm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 16:22:32 +0100, Vincent Guittot wrote... > On Wed, 18 Sep 2019 at 16:19, Patrick Bellasi wrote: [...] >> $> Wakeup path tunings >> ========================== >> >> Some additional possible use-cases was already discussed in [3]: >> >> - dynamically tune the policy of a task among SCHED_{OTHER,BATCH,IDLE} >> depending on crossing certain pre-configured threshold of latency >> niceness. >> >> - dynamically bias the vruntime updates we do in place_entity() >> depending on the actual latency niceness of a task. >> >> PeterZ thinks this is dangerous but that we can "(carefully) fumble a >> bit there." > > I agree with Peter that we can easily break the fairness if we bias vruntime Just to be more precise here and also to better understand, here I'm talking about turning the tweaks we already have for: - START_DEBIT - GENTLE_FAIR_SLEEPERS a bit more parametric and proportional to the latency-nice of a task. In principle, if a task declares a positive latency niceness, could we not read this also as "I accept to be a bit penalised in terms of fairness at wakeup time"? Whatever tweaks we do there should affect anyway only one sched_latency period... although I'm not yet sure if that's possible and how. >> - bias the decisions we take in check_preempt_tick() still depending >> on a relative comparison of the current and wakeup task latency >> niceness values. > > This one seems possible as it will mainly enable a task to preempt > "earlier" the running task but will not break the fairness > So the main impact will be the number of context switch between tasks > to favor or not the scheduling latency Preempting before is definitively a nice-to-have feature. At the same time it's interesting a support where a low latency-nice task (e.g. TOP_APP) RUNNABLE on a CPU has better chances to be executed up to completion without being preempted by an high latency-nice task (e.g. BACKGROUND) waking up on its CPU. For that to happen, we need a mechanism to "delay" the execution of a less important RUNNABLE task up to a certain period. It's impacting the fairness, true, but latency-nice in this case will means that we want to "complete faster", not just "start faster". Is this definition something we can reason about? Best, Patrick -- #include Patrick Bellasi