Received: by 10.223.176.5 with SMTP id f5csp1685451wra; Wed, 31 Jan 2018 10:00:17 -0800 (PST) X-Google-Smtp-Source: AH8x225PgXx2G8+M1zljJJxkpZP0QrB6znKnM4KaHbBlKSOKPdjT79HtbJm9oncaXpdgqbOjyK4I X-Received: by 10.98.153.197 with SMTP id t66mr32746322pfk.142.1517421617714; Wed, 31 Jan 2018 10:00:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517421617; cv=none; d=google.com; s=arc-20160816; b=B+35eYwVY1OFOfGI4FmR5nysFxuoUbCXUZz+MlMWgBiLX5CjlEantN7pZSHe7HTxlu JkTsHI6+kRgnJURflKz2SRbypP6cnCSNduiRAR58NTs5JszHeru4OPPC0NyP65bPSAYm jfCeNp07omrPUotA7WFVcHR6tnK1CmaI9nyBSlwiEhhIDfkdgVxQw1Curo4RJ4iV1sIC Q9tN6T5cz/c1y7gtAE5FVGac8l2UmTZZ1HqQd5bnpC/5B+KAiNaQCk/bnUUMkBTYCDvB +Xiu7j6J1Sx+AgeSU7aGIMSjahYmGW9J2YzVWX9sdl1b+UWycUBpaMOmlLr/z/KqhNuI /5Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=tg2QbwsYA9W4ao9df0JNyFYf0je+d26Bhu3xkmwdw7Q=; b=CBWa0f5hjaS69U5WRFM+wrQZnFQw1/6BHQfqZnQ8MAnBtJf3S2i6AFZa73wtr9Biru TRcEq8MkMw9GPIT3taBbgWoWq9P5EJzvMcT5ExgEuTch/pmwrt5yi+JHqsb6Rex2KBmy Maa3D3d6uyvDfrRhoOw78jSJ+gpsKAR25oMuEZbFZdpHVeiX7zG5JJZsImfVp21WOlPK y+ggvRniQV/Q+B2KUpFCeNhN1IXO0sIg0XkWAKTODxL9b+S19vOk/+Jj/WwSWDb504Ig 0F2FZVI3k4XxRgXYJRs0zaRXw/05kpnXK1xd4ZvmhNe472NCfJvzT9j7DWcW9gt/Iehh HpJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=oM+3igqm; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si553766plz.417.2018.01.31.10.00.02; Wed, 31 Jan 2018 10:00:17 -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=@oracle.com header.s=corp-2017-10-26 header.b=oM+3igqm; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932304AbeAaRqu (ORCPT + 99 others); Wed, 31 Jan 2018 12:46:50 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47196 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932286AbeAaRqt (ORCPT ); Wed, 31 Jan 2018 12:46:49 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0VHgUC5108987; Wed, 31 Jan 2018 17:46:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=tg2QbwsYA9W4ao9df0JNyFYf0je+d26Bhu3xkmwdw7Q=; b=oM+3igqmDxC9rGYPRXI3qxfv5K/wbvMTNCe2SdaWEWQPe6J49nHIizIDkkVmBTSb2K8S Q04Y7LD+S1II1AjQj2WsUAT7JbBiewJpUeC+zaG7OhquFZJmn5CIhb6XjMXj8pBCmdYH Q3BOj9afCwCzq8vDH4br8TFUKbhrUwjR0YBdkmLk+76/rlA+7nmFxnxl8LUDZHxwIsRU gNcgRyaSu0NGS+7QjeyuO9kBYxDJ0wibp2yR/GBcggj9umRvzsVhIji6JmEYxwSdh7HH cK1m0Z+4JC9LAxH8ii2v1NQas/0VqTWlxW4XrPnqlnDLqun2UvH76blJhxx183emw2kS 0Q== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2fucffj102-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2018 17:46:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0VHkCeD030136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2018 17:46:13 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0VHkBXx015413; Wed, 31 Jan 2018 17:46:12 GMT Received: from [10.132.91.66] (/10.132.91.66) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jan 2018 09:46:11 -0800 Subject: Re: [RESEND PATCH] sched/fair: consider RT/IRQ pressure in select_idle_sibling To: Joel Fernandes Cc: Peter Zijlstra , Ingo Molnar , LKML , steven.sistare@oracle.com, dhaval.giani@oracle.com, Dietmar Eggemann , Vincent Guittot , Morten Rasmussen , "Cc: EAS Dev" References: <1517268429-933-1-git-send-email-rohit.k.jain@oracle.com> <6967b972-129a-a7f0-06ab-c48dc9709726@oracle.com> From: Rohit Jain Message-ID: Date: Wed, 31 Jan 2018 09:50:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8791 signatures=668659 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310227 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/30/2018 05:57 PM, Joel Fernandes wrote: >>>> Signed-off-by: Rohit Jain >>>> --- >>>> 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. Hope I answered your question. Thanks, Rohit