Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4887715ybi; Mon, 3 Jun 2019 20:00:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJCXUOCXwkn4TWL24LxPvth4CghRma4IYandougQRfYCbMgaqKa/sNJ84JzzLsz3F3wrB5 X-Received: by 2002:a62:754d:: with SMTP id q74mr13432517pfc.211.1559617222295; Mon, 03 Jun 2019 20:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559617222; cv=none; d=google.com; s=arc-20160816; b=ETS3iljKXlp2SMYA1CBrqRkGdFXS6NCiaJqfrb5bCsIlrYpKTiBjffFdaVzeovyUtI ayXyhIfLa9BMBfH+VlqsONNVe/qV6UzTLCq5IFk9A3dm+5+sHyhoj7436qNoU8bg65/R vcCejRRRzQcUqLaBdWJkfubha8od8zynbpm+whlv4spY2FBwpB0GuqHODJ/y+jYsZ/A6 ImpgW6u63awrwH+j9luDQRFPrBLEMME5P7g/+s2hMjberuwxjR6RoVX1pMscDmOMHhgZ iaF3c5Cu4w0fgVlt5z5O8YKgRMGpoD7/mYLP1eX5FbGKlnJmssl5M8xllR/FjjN+E43/ wKqA== 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; bh=VLAZA3mAxtAxc7sjq/ycXQ3CaKlvlwmmoeCBvwMr7B8=; b=DmPAx6o+vKCbbdtyb2w3HLfgEH2FV34+HCT7bKDjgdAfFcTXnntRGblPGWzZD9Lzsx SGmCVuKf4LCOKWdlHETVVjo5Q8Xgh+sxmXZ5blwL44reGAUM+xbiIqjlra5nf3NuA/eS l/UFzU0mlK793RoitDNihO85DLmWVrV8li73+Ru+orsn9GnuCAzEHWsxVlbV/uZgpynH JZYpzHTr7UCYt7Sp54az2nUeNp4+dBRK54bs/sMxDk9UQTPbBFr26gFhDOVxfZ9arErN gfRHHURQ9+SXdhPJaJS/+Qba7x5NCu7S08IUZQSsPQQ9xKRHHNtcMh2XrQP8cXiTwRJC lZAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITvr9Khp; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si24234891pfi.23.2019.06.03.19.59.54; Mon, 03 Jun 2019 20:00:22 -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; dkim=pass header.i=@linaro.org header.s=google header.b=ITvr9Khp; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbfFDC6H (ORCPT + 99 others); Mon, 3 Jun 2019 22:58:07 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41156 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbfFDC6H (ORCPT ); Mon, 3 Jun 2019 22:58:07 -0400 Received: by mail-pl1-f193.google.com with SMTP id s24so7590571plr.8 for ; Mon, 03 Jun 2019 19:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VLAZA3mAxtAxc7sjq/ycXQ3CaKlvlwmmoeCBvwMr7B8=; b=ITvr9KhpT8ky5VlbXAeC73PK4m3joLBkof6irFxZHpCnty3heHbDfVg5eAlO9lQ2x+ J+7n/Qj4eJ8Yh2KAUsxBOOlUYbwGGHJyC82zqtWnNXW0fOs4kqnoFR//ffUXD4Gk3Uo6 uQLb0ZqLfp7m5cEepRI9bj0MqNBWv+ZlPJa/syTu7P1kLO3BmsrSJRQasidhQisjy2IW hzAznOo29tsvjDD7lEV1b98m0IuSZJ6OKgo6Q23meb/wLu6oaWDXVI3i2QB/J3EpDjf3 jcH2+l3ROuv6fySejyOu5rbAlIY4S7r1G2vd2yglkG4NEDvYAN2H8bS9RggTOP4YX59/ hkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VLAZA3mAxtAxc7sjq/ycXQ3CaKlvlwmmoeCBvwMr7B8=; b=YRYzC23ocI5SF+aUuG6mvhm5AU2zQKZzxltfO4zCmcXWHayttxPe9h4kt7lgEB+eDD VIR3ukflzEdSV7UYwnTLqHGn3S/y1eVwKUy3N9RYPOPnH2tH1J85S1UbShwJrn3IoFOA KWQmNo0xN1vaC2jSi+O8EJ1SBWzjOl6JlD96C5dm4npEtT6lhWsaBbzm+oc271aSYGBQ LdMxFqIcL66u29gCqUy6RdKx8kRHcMp6nPTiXH54PIyUa1+On9fKhxUg78DHqSSkFYwy efGCxLLvLSwqnchurS46Horm8ViFQe6IUgrckShNCh0nLaCqI0kOYnb9Pu927O65AM8B 9xAQ== X-Gm-Message-State: APjAAAUefSoluGvTv9EDCU1R1jM40qbHg/9mUDqTEDhSl/0gwJjuhLYU Pn+iV3MW3bmXLhTwEU3E4uc34ItsSt0= X-Received: by 2002:a17:902:2a69:: with SMTP id i96mr25404027plb.108.1559617086552; Mon, 03 Jun 2019 19:58:06 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id b15sm15929188pfi.141.2019.06.03.19.58.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 19:58:04 -0700 (PDT) Date: Tue, 4 Jun 2019 08:28:02 +0530 From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra Cc: Vincent Guittot , tkjos@google.com, Daniel Lezcano , quentin.perret@linaro.org, chris.redpath@arm.com, Dietmar.Eggemann@arm.com, linux-kernel@vger.kernel.org Subject: Re: [RFC V2 2/2] sched/fair: Fallback to sched-idle CPU if idle CPU isn't found Message-ID: <20190604025802.p7k5l3jhqrwbxy6j@vireshk-i7> References: <59b37c56b8fcb834f7d3234e776eaeff74ad117f.1556182965.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59b37c56b8fcb834f7d3234e776eaeff74ad117f.1556182965.git.viresh.kumar@linaro.org> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-04-19, 15:07, Viresh Kumar wrote: > We target for an idle CPU in select_idle_sibling() to run the next task, > but in case we don't find idle CPUs it is better to pick a CPU which > will run the task the soonest, for performance reason. A CPU which isn't > idle but has only SCHED_IDLE activity queued on it should be a good > target based on this criteria as any normal fair task will most likely > preempt the currently running SCHED_IDLE task immediately. In fact, > choosing a SCHED_IDLE CPU shall give better results as it should be able > to run the task sooner than an idle CPU (which requires to be woken up > from an idle state). > > This patch updates the fast path to fallback to a sched-idle CPU if the > idle CPU isn't found, the slow path can be updated separately later. > > Following is the order in which select_idle_sibling() picks up next CPU > to run the task now: > > 1. idle_cpu(target) OR sched_idle_cpu(target) > 2. idle_cpu(prev) OR sched_idle_cpu(prev) > 3. idle_cpu(recent_used_cpu) OR sched_idle_cpu(recent_used_cpu) > 4. idle core(sd) > 5. idle_cpu(sd) > 6. sched_idle_cpu(sd) > 7. idle_cpu(p) - smt > 8. sched_idle_cpu(p)- smt > > Though the policy can be tweaked a bit if we want to have different > priorities. > > Signed-off-by: Viresh Kumar > --- > kernel/sched/fair.c | 28 +++++++++++++++++++++------- > 1 file changed, 21 insertions(+), 7 deletions(-) Hi Peter, I was looking to send V3 with the changes you suggested for the patch 1/2, are there any changes that I should be doing in this patch along with it ? -- viresh