Received: by 10.192.165.148 with SMTP id m20csp4734873imm; Tue, 24 Apr 2018 07:36:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4rwVcbqNofM87fJ+y2rlDV5GW+lbCcnmfI6XOojnqkaynvsMj7YFMDHssBZMm5Iurv9vU X-Received: by 10.101.66.199 with SMTP id l7mr20971676pgp.335.1524580611891; Tue, 24 Apr 2018 07:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524580611; cv=none; d=google.com; s=arc-20160816; b=P8I7aaPGNqQY/eCVmTciqFKIcVfgrZz2DHc5xL6HPkvmoFFD9oFHE6n+LduNaPGD83 pOEdaYBN7pj5L9KpVwKlm8aoukbhIM99NrlqFNu9c4N8SLd7ZkYYxq1Lt8VN9ZuboGGH uUkdYrVaMXMAcoQlzWvninCir7qMsqHWWch7HvniqdQnVyec3vdOe3wm3QQu0qEmBHwn K5M5ZLNjShB81N/Q+PYiih/qUeDzTAhNuifg8J3Ssl8FQvW4hBjX9trjg4lJbSuTPjtG lMM+neyiqPYDNiFwQhZMrMCIOERai4EENwYn6jkRhdlprF35Pw6M8POLq+xUUdNbcfnj eu/g== 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=ZOu2iy4vfKCMcEqn8REEZBqL3afjjTWdrFc76gX6ySQ=; b=p5iXrG5fyT9fr9vYQOC5z0lltDGhN5ltE7+B38tilxIbJ3nGdEwHztgiYeSOx65sNa 1OJDydH14KgpmEeDMyreubID6iAEMhYuRQ/NZ+vIRWh+ZAixF/5qS5usPm7JL5PXdyKz sTgHRaxzX7IpfZU20jakReojv4EOi5nA6uA130dETpftHK4gbesDw2ReUsyR/EE1Xy9A MaCXH+Qr1c9n4dDxU2z7srbUJJov3qfHEfgn6NSGIJm/xzIGwsRKUf/8Hj2EJQGGM8XU 4scugkUmLiCCcat5bqsOwWmQk6oJpbnKtYgztI6IPvsD8jObDF3tm1EusXV2r+0wuxlT PyVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KESwh3DU; 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 s124si8672254pgc.4.2018.04.24.07.36.37; Tue, 24 Apr 2018 07:36:51 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KESwh3DU; 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 S933240AbeDXMyA (ORCPT + 99 others); Tue, 24 Apr 2018 08:54:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:32796 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933168AbeDXMxy (ORCPT ); Tue, 24 Apr 2018 08:53:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=ZOu2iy4vfKCMcEqn8REEZBqL3afjjTWdrFc76gX6ySQ=; b=KESwh3DU8X1+31HK+t4nH5aHq BqIOPJo7bFDiCJXjhrrV3wARf9onBlLBYfqGLwBQ8xWdHeZw0FZdYPC9TaN4LC1adSfr5TmXIY5XN LmEafaukE93//fcuD5YTggdEaKt06Fc0rra2VyqHG2Kw7neW0cSczI1QMcYLrjfCpVL9417j/PDvX acPEcBi1Hs91djqpJ9/SA2CXrF6a029eGMVbnzT9wS3cHwjRVT7UCba0Ri79KFXo5OZCoQLiGa1QQ nVVJC17sEuo6FL0hItT4pMBGdSfvpoppjpQi2dSGmqIEhk+Mw/1wNHC4DwnGjuL4oQc9qOEEIXv35 MQ4IG1Fwg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAxSB-0003jJ-D5; Tue, 24 Apr 2018 12:53:51 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DB296203BFAF1; Tue, 24 Apr 2018 14:53:49 +0200 (CEST) Date: Tue, 24 Apr 2018 14:53:49 +0200 From: Peter Zijlstra To: subhra mazumdar Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, daniel.lezcano@linaro.org, steven.sistare@oracle.com, dhaval.giani@oracle.com, rohit.k.jain@oracle.com Subject: Re: [PATCH 3/3] sched: limit cpu search and rotate search window for scalability Message-ID: <20180424125349.GU4082@hirez.programming.kicks-ass.net> References: <20180424004116.28151-1-subhra.mazumdar@oracle.com> <20180424004116.28151-4-subhra.mazumdar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424004116.28151-4-subhra.mazumdar@oracle.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 05:41:16PM -0700, subhra mazumdar wrote: > Lower the lower limit of idle cpu search in select_idle_cpu() and also put > an upper limit. This helps in scalability of the search by restricting the > search window. > @@ -6297,15 +6297,24 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > > if (sched_feat(SIS_PROP)) { > u64 span_avg = sd->span_weight * avg_idle; > - if (span_avg > 4*avg_cost) > + if (span_avg > 2*avg_cost) { > nr = div_u64(span_avg, avg_cost); > - else > - nr = 4; > + if (nr > 4) > + nr = 4; > + } else { > + nr = 2; > + } > } Why do you need to put a max on? Why isn't the proportional thing working as is? (is the average no good because of big variance or what) Again, why do you need to lower the min; what's wrong with 4? The reason I picked 4 is that many laptops have 4 CPUs and desktops really want to avoid queueing if at all possible.