Received: by 10.223.176.5 with SMTP id f5csp319456wra; Mon, 5 Feb 2018 22:52:29 -0800 (PST) X-Google-Smtp-Source: AH8x224VbJ5lRF47ccyInVVq20cS9lc5Bx2m+SEoz3J2qPPiDb2aFJDVP333lQNaf9Ne6YtKkEL3 X-Received: by 2002:a17:902:3383:: with SMTP id b3-v6mr1448142plc.240.1517899949010; Mon, 05 Feb 2018 22:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517899948; cv=none; d=google.com; s=arc-20160816; b=FTkUq8QTxAIaOsy8d8z4sPp7fNcfQSRoU1veidkYMBAQmkEAKdq4QxsPX0iDiAi4yR 2TD5BARxnyKOfQRF7DDiCQXpKy4XXGz/Ipf+KT5Yslh0BkZb3fNijBFIKYhDdukxCJzX ro705rRDmUSszIGGiVprRYXPxQHvsxUW4CFvA92YzkzONU1tPfW71jiHOdZqmnfv4MiN TsAnU73IGGcs2G7ItDL+c8g1Qvl6wfBdTnD8KmS7VdX1f3jfFf10eCKOVJ0NooHfUzOg +BNrQE5x2B0is2ewOm29rN0TFfPui6DjMm2rct6rla0soS6FV2RUX3iuhw3w+TGbxDxu XWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=mrV6EjxB1VoFpSqbIjn9NEEPiHx+OuWcYxC/dnTS2As=; b=hNyakCojjqxFoA2UkeQugnaAgMJ+t29YWFRpybBOjDqttt0kbVblIEG5l288RDtrVJ n0gmTbbclYni2/GrTE2g1YJLpXxUnHhNm/hRj9sNc4rmP3i4tEbxDSisWmSGDTa/BxSs 9HgDaRITHHh4Fb73r3o1Mi9LEPzumb4YfLzDbpxGP1LtV8gMqRDR9rE6ZdBTmtgAoz+L weXRpYceBpIb/roTPO4eKQKnw2DEf2Nb8EjJ/tIWtNt7NXg5UvCnwG3OiuRBpXHECWyC 9rbtGOhBlSyszomJ4Zxsg3ds5aFTYDPuSIhG+LwUWKfYyjo04JffdSJlwmhdzZYZx1IT FTbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dL2cjXrs; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10si1223641pfe.287.2018.02.05.22.52.13; Mon, 05 Feb 2018 22:52:28 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=dL2cjXrs; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbeBFGut (ORCPT + 99 others); Tue, 6 Feb 2018 01:50:49 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:33038 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbeBFGun (ORCPT ); Tue, 6 Feb 2018 01:50:43 -0500 Received: by mail-io0-f194.google.com with SMTP id n7so1378344iob.0 for ; Mon, 05 Feb 2018 22:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mrV6EjxB1VoFpSqbIjn9NEEPiHx+OuWcYxC/dnTS2As=; b=dL2cjXrs9nyIJz0eWaP5lqkQCTESTTq0lKrl1W/aID8QzfQLdjE+GUEHNpyW/JCp69 844dVbXLNUL4mPW61vMrlpFsN2SSQOGTtKFEVIiX/3ai2eNoKzjXpU8eRFAG0g2AqotO i9l9n/Pp9SuBSGXsa5knEQLAWZ4cI1OlBuYfH8hw+m02b4nnuNYr1fUeJKWkfFQt8KJ/ V8eVHnqGtyxzw1wK/a6gAyI6+NDnhWgREe6HZ7oigUJNupv6bBzkz32vCfXR1zZW3GG3 fsQxrighbH3iLSI3cQiFuJtcudYAl0I3+O/JG1wm8g9qVyhoKT/sWJ+2jfzEq8cg8SjD E7PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mrV6EjxB1VoFpSqbIjn9NEEPiHx+OuWcYxC/dnTS2As=; b=jRWSHOzRuzdo1K9TFoDqS54xSbjBBeSlYGkjG8SrofMVzv5skDccHghx9zYWutKfLg EOeHNODK+ZoMExgkN89G+6mZEsGRW8WpsWqaFeZ4jIDGmq+6CP2lafQmugfxzCZGPgqR 0LIJ33+Qe2zc/axZM+joZKcoazHDoY87RN+BtJVOCME50OadeBYx76gsdBYH7xosyJRq Nz71Ukpdc0IOmE7303fJb8J7u3u3ieCHPYgoiDkTA7SxiExKO8/m9JTvc2gsQsRjrLTl t3A+onfnicO/dQxM81/D7nUpyVJAia5Ua6wysOTNnbnUcCsK1P14Cfhv9n2UtK/P2sqP wvoA== X-Gm-Message-State: APf1xPCLsFFWeq5r5qKgR2AiMvRyr6usrOEhtTZNiqZLcGj3SmqyOwRL RC8jCMwvvK5v56MwwVojaxALanYr5dR4pn6FsgVeLQ== X-Received: by 10.107.142.202 with SMTP id q193mr1828121iod.100.1517899842483; Mon, 05 Feb 2018 22:50:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.172.135 with HTTP; Mon, 5 Feb 2018 22:50:41 -0800 (PST) In-Reply-To: References: <1517268429-933-1-git-send-email-rohit.k.jain@oracle.com> <6967b972-129a-a7f0-06ab-c48dc9709726@oracle.com> From: Joel Fernandes Date: Mon, 5 Feb 2018 22:50:41 -0800 Message-ID: Subject: Re: [RESEND PATCH] sched/fair: consider RT/IRQ pressure in select_idle_sibling To: Rohit Jain Cc: Peter Zijlstra , Ingo Molnar , LKML , steven.sistare@oracle.com, dhaval.giani@oracle.com, Dietmar Eggemann , Vincent Guittot , Morten Rasmussen , "Cc: EAS Dev" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 9:50 AM, Rohit Jain wrote: >>>>> kernel/sched/fair.c | 38 ++++++++++++++++++++++++++++---------- >>>>> 1 file changed, 28 insertions(+), 10 deletions(-) >>>>> >>>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >>>>> index 26a71eb..ce5ccf8 100644 >>>>> --- a/kernel/sched/fair.c >>>>> +++ b/kernel/sched/fair.c >>>>> @@ -5625,6 +5625,11 @@ static unsigned long capacity_orig_of(int cpu) >>>>> return cpu_rq(cpu)->cpu_capacity_orig; >>>>> } >>>>> >>>>> +static inline bool full_capacity(int cpu) >>>>> +{ >>>>> + return capacity_of(cpu) >= (capacity_orig_of(cpu)*3)/4; >>>>> +} >>>>> + >>>>> static unsigned long cpu_avg_load_per_task(int cpu) >>>>> { >>>>> struct rq *rq = cpu_rq(cpu); >>>>> @@ -6081,7 +6086,7 @@ static int select_idle_core(struct task_struct >>>>> *p, >>>>> struct sched_domain *sd, int >>>>> >>>>> for_each_cpu(cpu, cpu_smt_mask(core)) { >>>>> cpumask_clear_cpu(cpu, cpus); >>>>> - if (!idle_cpu(cpu)) >>>>> + if (!idle_cpu(cpu) || !full_capacity(cpu)) >>>>> idle = false; >>>>> } >>>> >>>> There's some difference in logic between select_idle_core and >>>> select_idle_cpu as far as the full_capacity stuff you're adding goes. >>>> In select_idle_core, if all CPUs are !full_capacity, you're returning >>>> -1. But in select_idle_cpu you're returning the best idle CPU that's >>>> the most cap among the !full_capacity ones. Why there is this >>>> different in logic? Did I miss something? >>>> > > > >> Dude :) That is hardly an answer to the question I asked. Hint: >> *different in logic*. > > > Let me re-try :) > > For select_idle_core, we are doing a search for a fully idle and full > capacity core, the fail-safe is select_idle_cpu because we will re-scan > the CPUs. The notion is to select an idle CPU no matter what, because > being on an idle CPU is better than waiting on a non-idle one. In > select_idle_core you can be slightly picky about the core because > select_idle_cpu is a fail safe. I measured the performance impact of > choosing the "best among low cap" vs the code changes I have (for > select_idle_core) and could not find a statistically significant impact, > hence went with the simpler code changes. That's Ok with me. Just that I remember Peter messing with this path and that it was expensive to scan too much for some systems. The other thing is you're really doing to do a "fail safe" as you call it search here with SIS_PROP set. Do you see a difference in perf when doing the same approach as you took in select_idle_core? Peter, are you with the approach Rohit has adopted to pick best capacity idle CPU in select_idle_cpu? I guess nr--; will bail out early if we have SIS_PROP set, incase the scan cost gets too much but then again we might end scanning too few CPUs. thanks, - Joel