Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp949982ybe; Thu, 5 Sep 2019 08:14:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMRfKED+7zOSlBBjsI9BzFycdfpehZjYYMU0K3jfQb8twSktZx4zufIk3aNHMtCKKTEG3r X-Received: by 2002:a17:90a:4c:: with SMTP id 12mr4289776pjb.40.1567696444912; Thu, 05 Sep 2019 08:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567696444; cv=none; d=google.com; s=arc-20160816; b=JovPoOOOPOWL/evU+FN+9wPb5Frs+ej2B0HeMBtLzix9x9MtBKcPXXcA3MMHHx2Pnc cSQOAazjydAlZJVxmFOxdsArnd6DGJkGwAG/aSWSa4Y243kT+Uo2VEs/VkoVQakmoy9y IKfHKdLvTzSTDHPKxTI3muZjVP3kqlEY9+MWvHAKZbV6/A8T36oGpvifeDnbTBIVp3wy ZcTGXmXAqwJF+KU9fNMjW86BKkS8WTlHYi/KRhWASGRp/4YxxQFO9nW57Z8gl1m1zgGS rah9YKN0BnIELmIiXcm1rLRh4X4NxAMMHByVNh0dN47Knd6unXMXi48CPOoEO+Xc7Vtf D1Uw== 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=n6+5kYSRKkxhmiaxpJseixzxOCDQiX4V0YkV7/5yxR4=; b=xFpWKwtuK+IvBn8mjcaEePUzycZzq+Tg8D3dBeViC1nAKfHdllBWlCWr8uh8gUYbif vRCY4b9dd/aEJxV0QRmX7RW85HSDosDjxBbOxCSFtMbFc5Wx7kD3/d5kHJVLXCalf3bH pxU/iLmvY+3zUC6lR1a9zm2rYARsfUKRYpsDHcWjhMzGAYVUjYuWzZewNxvslmk1I/Ze PbTIbVYfIlvsNMtkYnl9DbNakPw1AuqCz2SbbSjlZz7a9CJyd9IYwvV4vVM13O/cY4wU OSH7DebovKq7XaWKJhXgwBpuMRtIYP9UmgOLNga10U0UzbfFILgEBxKbi73TIOaHN+75 nqFA== 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 t24si2095808plr.420.2019.09.05.08.13.47; Thu, 05 Sep 2019 08:14:04 -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 S1732133AbfIELqn (ORCPT + 99 others); Thu, 5 Sep 2019 07:46:43 -0400 Received: from foss.arm.com ([217.140.110.172]:43226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730780AbfIELqn (ORCPT ); Thu, 5 Sep 2019 07:46:43 -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 7FB3B28; Thu, 5 Sep 2019 04:46:40 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3B523F718; Thu, 5 Sep 2019 04:46:38 -0700 (PDT) Subject: Re: [RFC PATCH 1/9] sched,cgroup: Add interface for latency-nice To: Patrick Bellasi , Peter Zijlstra Cc: Subhra Mazumdar , linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, steven.sistare@oracle.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, viresh.kumar@linaro.org, tim.c.chen@linux.intel.com, mgorman@techsingularity.net, parth@linux.ibm.com References: <20190830174944.21741-1-subhra.mazumdar@oracle.com> <20190830174944.21741-2-subhra.mazumdar@oracle.com> <20190905083127.GA2332@hirez.programming.kicks-ass.net> <87r24v2i14.fsf@arm.com> <20190905104616.GD2332@hirez.programming.kicks-ass.net> <87imq72dpc.fsf@arm.com> From: Valentin Schneider Message-ID: Date: Thu, 5 Sep 2019 12:46:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87imq72dpc.fsf@arm.com> 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 05/09/2019 12:18, Patrick Bellasi wrote: >> There's a few things wrong there; I really feel that if we call it nice, >> it should be like nice. Otherwise we should call it latency-bias and not >> have the association with nice to confuse people. >> >> Secondly; the default should be in the middle of the range. Naturally >> this would be a signed range like nice [-(x+1),x] for some x. but if you >> want [0,1024], then the default really should be 512, but personally I >> like 0 better as a default, in which case we need negative numbers. >> >> This is important because we want to be able to bias towards less >> importance to (tail) latency as well as more importantance to (tail) >> latency. >> >> Specifically, Oracle wants to sacrifice (some) latency for throughput. >> Facebook OTOH seems to want to sacrifice (some) throughput for latency. > > Right, we have this dualism to deal with and current mainline behaviour > is somehow in the middle. > > BTW, the FB requirement is the same we have in Android. > We want some CFS tasks to have very small latency and a low chance > to be preempted by the wake-up of less-important "background" tasks. > > I'm not totally against the usage of a signed range, but I'm thinking > that since we are introducing a new (non POSIX) concept we can get the > chance to make it more human friendly. > > Give the two extremes above, would not be much simpler and intuitive to > have 0 implementing the FB/Android (no latency) case and 1024 the > (max latency) Oracle case? > For something like latency-, I don't see the point of having such a wide range. The nice range is probably more than enough - and before even bothering about the range, we should probably agree on what the range should represent. If it's niceness, I read it as: positive latency-nice value means we're nice to latency, means we reduce it. So the further up you go, the more you restrict your wakeup scan. I think it's quite easy to map that into the code: current behaviour at 0, with a decreasing scan mask size as we go towards +19. I don't think anyone needs 512 steps to tune this. I don't know what logic we'd follow for negative values though. Maybe latency-nice -20 means always going through the slowpath, but what of the intermediate values? AFAICT this RFC only looks at wakeups, but I guess latency-nice can be applied elsewhere (e.g. load-balance, something like task_hot() and its use of sysctl_sched_migration_cost). > Moreover, we will never match completely the nice semantic, give that > a 1 nice unit has a proper math meaning, isn't something like 10% CPU > usage change for each step? > > For latency-nice instead we will likely base our biasing strategies on > some predefined (maybe system-wide configurable) const thresholds. > > Could changing the name to "latency-tolerance" break the tie by marking > its difference wrt prior/nice levels? AFAIR, that was also the original > proposal [1] by PaulT during the OSPM discussion. > > Best, > Patrick > > [1] https://youtu.be/oz43thSFqmk?t=1302 >