Received: by 10.223.176.5 with SMTP id f5csp620853wra; Fri, 9 Feb 2018 04:38:19 -0800 (PST) X-Google-Smtp-Source: AH8x226awQEQkvoftpqFVbV26sPN8IoY+Fy46NwZNn7rB+pcSzRoQMWqUdBHdl0gwvQFWiA3JpId X-Received: by 2002:a17:902:4e25:: with SMTP id f34-v6mr2413090ple.68.1518179899869; Fri, 09 Feb 2018 04:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518179899; cv=none; d=google.com; s=arc-20160816; b=LSSIumT8BjXifuo1tKTD8W8qy3/z2zAoEruyffSGZfSRW0P+OOUxb8sHXaDOu9vQAB A7sVEz1+egoqO5gqQL81fm5n+8MyXvm8TSjLAtVn0PWqBl5PXVuJ94IA+FV0QlkMIFDB MzVxnLua/yzVPSXNzLMxi21L/fcH6N1GfpPcijk+Kq69P5GEX574IVNgSeORXzTdB8ZP 4Kz1za52qWcmtvmBhqpcewvCrmtmqOGO+1nYhRVJIBq0Y1Kxx6JE1yQMVlDhjeaE0eyT Q8CkraqdfpC8UaMeW7Kf80QBN6JDFD7yX1R8B5Pv1WlMvqmsnhgrnn76dDIHKYes35Yq g38Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=2Qz2Ty62OJ+kTf0G0VhYK0ax6in5XGpiZLdK/bbsb5w=; b=sP6p+ttgSkI86uVCLNGG/0V5qfKqUviPuLxlqN9PjYIjvu68erEZ/YtjDGz1gmrsjf 3dKa8xHzSOsGareoXg+lBZFBTap89NJvcRaLC7tYZJ44ybnDpZeUq5MunbkwjPm9j7sR C0EcDx/zfRyTc5bmry6BqXhXSo+QS7Vsg4kv39hGtCem6EXmUEgIQW0Geb6zGxdKmYT5 QnnT0WV84ytRP68t9gxzLqO9YyuZWIpg/w7wb5s2/DzkivhWmdksvCtJYKiVgCVJlY7g F/doOS9MZt3H4LSOGeg7SwkoWaTfHo6PVUKRz9v2ngelxsEYddO9MpTuW7mrE53CUqBR SvmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bHOcLlZj; 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 c129si1624536pfa.362.2018.02.09.04.38.05; Fri, 09 Feb 2018 04:38:19 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bHOcLlZj; 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 S1751179AbeBIMfw (ORCPT + 99 others); Fri, 9 Feb 2018 07:35:52 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53260 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbeBIMfv (ORCPT ); Fri, 9 Feb 2018 07:35:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2Qz2Ty62OJ+kTf0G0VhYK0ax6in5XGpiZLdK/bbsb5w=; b=bHOcLlZjBPa+QD+WOWVRdr98x HD4b8rvBWfwUU2LnYFxqturEO1+t5w4K4vVkI9HNMK+hQpdvfTximjSvtDbrcCuh4O7XFtGu15xSR KT9+wxsk5xOeegYjZJ+TM/zSElCBa2Lq7fw8K45aUSOYWPTfLug2btaKjVYQy4e6TfchF2spZJXfu 6UtZ53jGZU+I1vIEVuJ6lKeCtm0KlDbJZTZXfWkLlmb/zWoPcSWnvvlFQaKVeea+8RdKGWBOjwNC4 IgWJD682so/PPYXK2xgKb7QPE37nAFZbee07OtSJ8k5xamWTbFoB8Gv99njluhly5ElQ+gVbnyVf6 lDcob16dA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ek7u1-0007tB-VO; Fri, 09 Feb 2018 12:35:42 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 60C2F20288BBC; Fri, 9 Feb 2018 13:35:39 +0100 (CET) Date: Fri, 9 Feb 2018 13:35:39 +0100 From: Peter Zijlstra To: Joel Fernandes Cc: Rohit Jain , Ingo Molnar , LKML , steven.sistare@oracle.com, dhaval.giani@oracle.com, Dietmar Eggemann , Vincent Guittot , Morten Rasmussen , "Cc: EAS Dev" Subject: Re: [RESEND PATCH] sched/fair: consider RT/IRQ pressure in select_idle_sibling Message-ID: <20180209123539.GM25201@hirez.programming.kicks-ass.net> References: <1517268429-933-1-git-send-email-rohit.k.jain@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 07:39:15PM -0800, Joel Fernandes wrote: > > @@ -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? select_idle_core() wants to find a whole core that's idle, the way he changed it we'll not consider a core idle if one (or more) of the siblings have a heavy IRQ load. select_idle_cpu() just wants an idle (logical) CPU, and here it looks for > > > > @@ -6102,7 +6107,8 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int > > */ > > static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int target) > > { > > - int cpu; > > + int cpu, rcpu = -1; > > + unsigned long max_cap = 0; > > > > if (!static_branch_likely(&sched_smt_present)) > > return -1; > > @@ -6110,11 +6116,13 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t > > for_each_cpu(cpu, cpu_smt_mask(target)) { > > if (!cpumask_test_cpu(cpu, &p->cpus_allowed)) > > continue; > > - if (idle_cpu(cpu)) > > - return cpu; > > + if (idle_cpu(cpu) && (capacity_of(cpu) > max_cap)) { > > + max_cap = capacity_of(cpu); > > + rcpu = cpu; > > At the SMT level, do you need to bother with choosing best capacity > among threads? If RT is eating into one of the SMT thread's underlying > capacity, it would eat into the other's. Wondering what's the benefit > of doing this here. Its about latency mostly I think; scheduling on the other sibling gets you to run faster -- the core will interleave the SMT threads and you don't get to suffer the interrupt load _as_bad_. If people really cared about their RT workload, they would not allow regular tasks on its siblings in any case.