Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2182857ybi; Thu, 18 Jul 2019 04:40:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaXfmZ550fYb1DUazwdEgHH1lmScpRf8X09m1gdIyAz8mk73w1fWIjMIn6Aju1EkMrqMed X-Received: by 2002:a63:2a08:: with SMTP id q8mr15238260pgq.415.1563450055781; Thu, 18 Jul 2019 04:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563450055; cv=none; d=google.com; s=arc-20160816; b=d6kkGm3LIJLxdnxImUFfd54ECyVnmtZMxIPdz3F4EDGkzX7U1W1FQLQhc2Ysoq0Q44 ncSUEanGB5HkT4SYv5PjGP0z/88dtsxuRuySCqKza967NfyF8z08oQRbQfiLnExiPHy6 BugdAhM8z/IwiqcejqtJwh6mO30OKud/wGisGd2G5G2R3j9tpcLRzzhGLvg385oYHmoO mXq7bjve6tzclRr8R+wZy21S8xLQBCwfy569bzrnAWDEHubK+PsNyd6iILuJ/+ATgP4f DQoC41GVRwZ6CblzP85tSKEYw0mmexlcleQ1h/3ejQN7qEi/f8fBa+BZKsCsRPBnIxPl mv2w== 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=1XG9ETPfNXBdNR3murMRWQhuyxiiIWkFmuE6S3E2wT8=; b=BhV5MU2CugTKWjZcneAOUp3vBmdrMWQoq/xj+7koiAWdosNdhDFXDZZol7MhK0bbxZ Wd1ozitKabHiml2jjoxR6fJCOIq+Jyk25aNqFfegW3HEZSQi/3pByBnRGD/hHxnutk9f uHi34FfO0A+mDMtk1KASlA4RVVouDFAu2VAvmURJggHHj2dckf6kQdDHYw486kp1LdSn veZsfGZKd1rpNjCXmU3Wtq1ucsDHxvZHc+1Ys4vPWGJs3n9xGTRZy8CAWl8lWf8o08wj MiP29VdWvhd0rkBxoX34TbOwG7pdL2tdWoEhU7lSLpvBrYAq6xHRuehvg255zAQH1X+K LEHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="1/o08/7t"; 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 v136si27513794pfc.9.2019.07.18.04.40.39; Thu, 18 Jul 2019 04:40:55 -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=merlin.20170209 header.b="1/o08/7t"; 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 S2390185AbfGRLiX (ORCPT + 99 others); Thu, 18 Jul 2019 07:38:23 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43324 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390175AbfGRLiX (ORCPT ); Thu, 18 Jul 2019 07:38:23 -0400 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=1XG9ETPfNXBdNR3murMRWQhuyxiiIWkFmuE6S3E2wT8=; b=1/o08/7tmX+HDtavM1ps+YmJb MhYxip3PmYG60pHlETONIUpfVDnYkS1v+bG/HXysh/59aCdbHUOzVyWiI7GlO2LPlUqh3CkCCsyTk lWTPjsmj+7gGGhiNnOsTXNQ5VgvFl3ad4WssRDPUvwt8qbmdKh/3tBe3PKdhh4/REyVTtBZU1b5u7 hl40aTazOPDFSG1gAxTz4TIQTHXDa6aFL3VZg11Eo9K18p6xDYRmcaKJbLuMyph8GYAWak3TnjCyv Yts4VkIHfqpIBRI7pGZS8zY0yDb95xKKJdE9wNb6sLYt9EXYOfz0GuAcjkU7XauiCK3nO7GWeMF1u qcNHrqcGg==; 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.92 #3 (Red Hat Linux)) id 1ho4jX-0003CC-TY; Thu, 18 Jul 2019 11:38:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A42B920197A71; Thu, 18 Jul 2019 13:37:58 +0200 (CEST) Date: Thu, 18 Jul 2019 13:37:58 +0200 From: Peter Zijlstra To: Subhra Mazumdar Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, prakash.sangappa@oracle.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, viresh.kumar@linaro.org, tim.c.chen@linux.intel.com, mgorman@techsingularity.net, Paul Turner Subject: Re: [RFC PATCH 2/3] sched: change scheduler to give preference to soft affinity CPUs Message-ID: <20190718113758.GN3402@hirez.programming.kicks-ass.net> References: <20190626224718.21973-1-subhra.mazumdar@oracle.com> <20190626224718.21973-3-subhra.mazumdar@oracle.com> <20190702172851.GA3436@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 17, 2019 at 08:31:25AM +0530, Subhra Mazumdar wrote: > > On 7/2/19 10:58 PM, Peter Zijlstra wrote: > > On Wed, Jun 26, 2019 at 03:47:17PM -0700, subhra mazumdar wrote: > > > The soft affinity CPUs present in the cpumask cpus_preferred is used by the > > > scheduler in two levels of search. First is in determining wake affine > > > which choses the LLC domain and secondly while searching for idle CPUs in > > > LLC domain. In the first level it uses cpus_preferred to prune out the > > > search space. In the second level it first searches the cpus_preferred and > > > then cpus_allowed. Using affinity_unequal flag it breaks early to avoid > > > any overhead in the scheduler fast path when soft affinity is not used. > > > This only changes the wake up path of the scheduler, the idle balancing > > > is unchanged; together they achieve the "softness" of scheduling. > > I really dislike this implementation. > > > > I thought the idea was to remain work conserving (in so far as that > > we're that anyway), so changing select_idle_sibling() doesn't make sense > > to me. If there is idle, we use it. > > > > Same for newidle; which you already retained. > The scheduler is already not work conserving in many ways. Soft affinity is > only for those who want to use it and has no side effects when not used. > Also the way scheduler is implemented in the first level of search it may > not be possible to do it in a work conserving way, I am open to ideas. I really don't understand the premise of this soft affinity stuff then. I understood it was to allow spreading if under-utilized, but group when over-utilized, but you're arguing for the exact opposite, which doesn't make sense. > > And I also really don't want a second utilization tipping point; we > > already have the overloaded thing. > The numbers in the cover letter show that a static tipping point will not > work for all workloads. What soft affinity is doing is essentially trading > off cache coherence for more CPU. The optimum tradeoff point will vary > from workload to workload and the system metrics of coherence overhead etc. > If we just use the domain overload that becomes a static definition of > tipping point, we need something tunable that captures this tradeoff. The > ratio of CPU util seemed to work well and capture that. And then you run two workloads with different characteristics on the same box. Global knobs are buggered.