Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp848651ybe; Thu, 5 Sep 2019 06:53:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6cAGGHsNcD3zeTiwYwMtDgdfOi9gGNk0JdrqKLgOOwv8ZpZODWDUwyjfA2EFeSDgYhSOL X-Received: by 2002:a65:5043:: with SMTP id k3mr3380905pgo.406.1567691622489; Thu, 05 Sep 2019 06:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567691622; cv=none; d=google.com; s=arc-20160816; b=Y9MUfLa5nQtkPasqvtXtIM5zDl6rDSlmBKotwENv+RFjvaSRAkD7O8BFmnInXnIa8G voi7/00EATo2agpZgJvVpzarT7Gznh9mjC2nE6cCAMlc4eDusoxWsutmcOhY2PQt5IYa 27f+WsQNiOs6iO1ZSIByo+09gs/N66iwe20+Os3w3UtIJYAWYfA5xM/53bGEMTls1mME zO0Q3uEQOQaK9m4w3Wcy0W68kNgiWgZdCCS6lsyv5yCCrbGpHY66uWk3aHNUdYit/Bu0 z+RlP38777iT9vOMX9BXYYk1mvHpU5NKYTW/VLG6H/ZNQ1F/N/E9kKSmIbo+yD2PlfCG LIJg== 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=pPek+FTs9/pK34cQMSveIWioxFXNEiEDhJBOAT7F58E=; b=ZF2wFL/jY/AbRJV8UQda8AAGv1dejkJb5l6zKsi5Ru0WcvACO945kLND1G5iWi7v2Y z4gkT2h8H9MGk8+f2milJfWDC+mfqibuUWzUIuDM2Xo43k4Wn1JQtADCN8W39EzGvNQe G/GBYKpNutwjecpqm7WCPOVACymo/yKf09QZgjVnWNJNU5ZVVhoqF4OesSDHWENBdwRz XA1rebSB3iOTNT5ib3I4/sV2IMlcXhLvc3d4kI+d8nOeW28Ryxf4TY54+F3IbJrIvjLL /3l3uq2BzUaRDGHdOJzAn6nizBliyoahfSlLfwnmbxh1RLqtg8L8GNYJJ7eAIV4AJNd0 Yzxw== 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 k8si378789pll.107.2019.09.05.06.53.26; Thu, 05 Sep 2019 06:53:42 -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 S1732166AbfIENH7 (ORCPT + 99 others); Thu, 5 Sep 2019 09:07:59 -0400 Received: from foss.arm.com ([217.140.110.172]:44802 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfIENH7 (ORCPT ); Thu, 5 Sep 2019 09:07:59 -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 27A4728; Thu, 5 Sep 2019 06:07:58 -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 57CE53F67D; Thu, 5 Sep 2019 06:07:56 -0700 (PDT) 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> User-agent: mu4e 1.3.3; emacs 26.2 From: Patrick Bellasi To: Valentin Schneider Cc: Peter Zijlstra , 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 Subject: Re: [RFC PATCH 1/9] sched,cgroup: Add interface for latency-nice In-reply-to: Date: Thu, 05 Sep 2019 14:07:54 +0100 Message-ID: <87d0ge3n85.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 Thu, Sep 05, 2019 at 12:46:37 +0100, Valentin Schneider wrote... > 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? Yep, I think so fare we are all converging towards the idea to use the a signed range. Regarding the range itself, yes: 1024 looks very oversized, but +-20 is still something which leave room for a bit of flexibility and it also better matches the idea that we don't want to "enumerate behaviours" but just expose a knob. To map certain "bias" we could benefit from a slightly larger range. > AFAICT this RFC only looks at wakeups, but I guess latency-nice can be For the wakeup path there is also the TurboSched proposal by Parth: Message-ID: <20190725070857.6639-1-parth@linux.ibm.com> https://lore.kernel.org/lkml/20190725070857.6639-1-parth@linux.ibm.com/ we should keep in mind. > applied elsewhere (e.g. load-balance, something like task_hot() and its > use of sysctl_sched_migration_cost). For LB can you come up with some better description of what usages you see could benefit from a "per task" or "per task-group" latency niceness? Best, Patrick -- #include Patrick Bellasi