Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp574700ybj; Thu, 19 Sep 2019 19:31:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5a5riF6epT0cIqs0yPUtiZiusHUIqEnMAG+/JpscnXluDKJ078/+Ebe+osNDaUZCxq+Uz X-Received: by 2002:a17:906:57ce:: with SMTP id u14mr5655595ejr.184.1568946676601; Thu, 19 Sep 2019 19:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568946676; cv=none; d=google.com; s=arc-20160816; b=LnRYVKIQxW8lIUB7/KpJ1hvJi7SGrEDTI0vRETpdufL9tHmgUk8/nZzM38eiRwHLoO U8LL8GWLndJ6PQH8ZjzsALtzR+XhefB67oC9offaScNgyWuUMxt+l1N8Z49vmAjCdmLS VuyB4hHrqjAUu/N6f02QcuznGoI6V3/58L3iBKXIYFQO1eGhdoUhwlDYrvjYVTyC2zVD tJst3idW1LBVUyT1JL9VKsM5Gi7DwpFb6hjtNV+G8JAgP5qupJZAQqMCaIByhd+t+bkg tLsRAaKFaY/gvZkeAz8r4xLorDxdpP0O/klDAKGkgAL9tmV/pdgzW5vtW3x58Ii9uglS PvCw== 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=HToZ2x2AGZ05zPckS3c7RMujlP29dKEGtfzucFMaOvk=; b=Z9+8ulHYwAYDKH3/kp5W0F8oj0ksUskUu8YSPyjcGPJ3sbtVMDBGKlEmcEk6Z6sxx0 1vAzRHLwj1OZj/ba4FyuEgkWPFwe+v++7nn5NHYVjweigACcfuNQg3c2zsI+pJnr0DRu GeeH8jSFfkcGrsftpJxmbgufTx7P0y6LX4XMJd+jjAHSDvpq+f1CrX74UvaSF7yZRYtV 4VfBCu9PjBJY/cYYEi39/r4PzlPEuy7JNaZAqvpXZub8gISnlcCk3/QZLnht8YE6Z4cy cKwUo2+DZ60/kvDmfqw5C4AxueUYOALuZhuhV6ykDVmxVsZ7PPdDl51Vgg875qUTCqaz 4CqQ== 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 z6si461341edm.316.2019.09.19.19.30.53; Thu, 19 Sep 2019 19:31:16 -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 S2391324AbfISSHX (ORCPT + 99 others); Thu, 19 Sep 2019 14:07:23 -0400 Received: from foss.arm.com ([217.140.110.172]:35136 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391305AbfISSHX (ORCPT ); Thu, 19 Sep 2019 14:07: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 6C87128; Thu, 19 Sep 2019 11:07:22 -0700 (PDT) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE27A3F59C; Thu, 19 Sep 2019 11:07:19 -0700 (PDT) Subject: Re: Usecases for the per-task latency-nice attribute To: Parth Shah , Patrick Bellasi Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , subhra mazumdar , tim.c.chen@linux.intel.com, mingo@redhat.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, pjt@google.com, vincent.guittot@linaro.org, quentin.perret@arm.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, tj@kernel.org, rafael.j.wysocki@intel.com, qais.yousef@arm.com, Patrick Bellasi References: <3e5c3f36-b806-5bcc-e666-14dc759a2d7b@linux.ibm.com> <87woe51ydd.fsf@arm.com> <77457d5b-185e-1548-4a5c-9b911b036cec@arm.com> From: Valentin Schneider Message-ID: <37d12346-4249-d699-70b7-fc24a5774fb3@arm.com> Date: Thu, 19 Sep 2019 19:07:09 +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: 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 19/09/2019 17:41, Parth Shah wrote: > So jotting down separately, in case if we think to have "latency-nice" > terminology, then we might need to select one of the 2 interpretation: > > 1). >> -20 (least nice to latency, i.e. sacrifice latency for throughput) >> +19 (most nice to latency, i.e. sacrifice throughput for latency) >> > > 2). > -20 (least nice to other task in terms of sacrificing latency, i.e. > latency-sensitive) > +19 (most nice to other tasks in terms of sacrificing latency, i.e. > latency-forgoing) > > I'd vote for 1 (duh) but won't fight for it, if it comes to it I'd be happy with a random draw :D >> Aren't we missing the point about tweaking the sched domain scans (which >> AFAIR was the original point for latency-nice)? >> >> Something like default value is current behaviour and >> - Being less latency-sensitive means increasing the scans (e.g. trending >> towards only going through the slow wakeup-path at the extreme setting) >> - Being more latency-sensitive means reducing the scans (e.g. trending >> towards a fraction of the domain scanned in the fast-path at the extreme >> setting). >> > > Correct. But I was pondering upon the values required for this case. > Is having just a range from [-20,19] even for larger system sufficient enough? > As I said in the original thread by Subhra, this range should be plenty enough IMO. You get ~5% deltas in each direction after all. >>> >> >> $> Load balance tuning >> ====================== >> >> Already mentioned these in [4]: >> >> - Increase (reduce) nr_balance_failed threshold when trying to active >> balance a latency-sensitive (non-latency-sensitive) task. >> >> - Increase (decrease) sched_migration_cost factor in task_hot() for >> latency-sensitive (non-latency-sensitive) tasks. >> > > Thanks for listing down your ideas. > > These are pretty useful optimization in general. But one may wonder if we > reduce the search scans for idle-core in wake-up path and by-chance selects > the busy core, then one would expect load balancer to move the task to idle > core. > > If I got it correct, the in such cases, the sched_migration_cost should be > carefully increased, right? > IIUC you're describing a scenario where we fail to find an idle core due to a wakee being latency-sensitive (thus shorter scan), and place it on a rq that already has runnable tasks (despite idle rqs being available). In this case yes, we could potentially have a balance attempt trying to pull from that rq. We'd try to pull the non-running tasks first, and if a latency-sensitive task happens to be one of them we should be careful with what we do - a migration could lead to unwanted latency. It might be a bit more clear when you're balancing between busy cores - overall I think you should try to migrate the non-latency-sensitive tasks first. Playing with task_hot() could be one of the ways to do that, but it's just a suggestion at this time. > >>>> References: >>>> =========== >>>> [1]. https://lkml.org/lkml/2019/8/30/829 >>>> [2]. https://lkml.org/lkml/2019/7/25/296 >>> >>> [3]. Message-ID: <20190905114709.GM2349@hirez.programming.kicks-ass.net> >>> https://lore.kernel.org/lkml/20190905114709.GM2349@hirez.programming.kicks-ass.net/ >>> >> >> [4]: https://lkml.kernel.org/r/3d3306e4-3a78-5322-df69-7665cf01cc43@arm.com >> >>> >>> Best, >>> Patrick >>> > > Thanks, > Parth >