Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3614213ybi; Tue, 2 Jul 2019 10:30:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwXzm1uxdVfe+V1W7EK5Rmf1nndIQPYIihIstmFmQH2D6OQNG/7VyBQLVNTyrsAo1ewKXl X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr7050331pjq.32.1562088612101; Tue, 02 Jul 2019 10:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562088612; cv=none; d=google.com; s=arc-20160816; b=Remuws2z4mCfsCeZkUBET/UAgAQayq8dJ3nCSvEHC4hiZ0TFMaecmrjqqskvZstN6Y Enllmh5keF7ywt6HfGSPv3K3zqTIzEGD506xEKp9mrb3XKQs1k3xikJOFUV9T1U4Ngj5 J+opKJP8zqP7m7+iFNFExOi4f8AUNXLaa/sEGAs+9ANglrkwOxSU1ShGwqffmci06fVf X56ahFYzjqYDIcfC0a6bMKmBj6LtlEq5A6R8OAuoUnwtwEXYnPKQtMEKfm2dWzFxGkHy g/p8QYFx0lqRqcaKNCD0Q7L0GqnFnCNE7Vt6srUrd/cUW6HoYsx5YZJFbUPoRIEr3B3K +XWA== 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=KZ9VwrqG/IRp4jX6fSDNnOQ7RxZe+lhI8MIeh/ntJvc=; b=bt1YjurZLnYkS/YlD85l9zJ1jhioFdC/QRvjf27sw+Bo6Cv9sl8BN6fNu93ER76jON KWStC9Zfwq0KMDRn2dvUi/ILwNnoscb60N7hSGohMGAWUy2fxA5Z0Be2faTN6MJcZs63 pXxwezcnha0k7f8l7qyyD6fQq5JgJQsnjKrhZY6Exdui2HyR6KkjHtu1bLlEDPtO8gQq GGQ8R4zWUi1h15ZsTvEIXSHyZc62A82S0rYhEgt8/ep04O/lFZ9K+3O0QKDrj0tQmZRs cvIfyZK7cIEY/jc890K7RNV9m5GRx0FfRFd0qn7uLc0pteJEgMO6/zaS5sbP6DTEv1qV 9jBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=X3u0nH0m; 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 x11si12802538pln.292.2019.07.02.10.29.57; Tue, 02 Jul 2019 10:30:12 -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=X3u0nH0m; 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 S1726984AbfGBR3E (ORCPT + 99 others); Tue, 2 Jul 2019 13:29:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52794 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfGBR3E (ORCPT ); Tue, 2 Jul 2019 13:29:04 -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=KZ9VwrqG/IRp4jX6fSDNnOQ7RxZe+lhI8MIeh/ntJvc=; b=X3u0nH0mK7iK5vfuzWUwfEpES inDQvv1lBCUsjKB9eKo35Yw9CvUt/spXfQq3ez0zMFuh6Kd26gxFAPM3VPrb3pr0HOROcOSmRGeMj /N1wjvNRqZKuVrVsX+aMCbOs8Hre3/hmcNkYCD+j4/Lr079GgQaFcAI2n4fC2zYRWFZpOJQsIYcdj Uu76KcdxP3OZfFfe8iRE1bsKntUg231W694I2dFFrOngjF+MuKuPhnBYAZsE/RdxTCJArO1L9Lwbo m/3WiFDm41OEv7QNJFZw56lvfIkdRkkkUz75ft1KiCCmMPoVliVvQhQfttZjwvx5m4RGbtYIx1qAl xQsgjWMow==; 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.92 #3 (Red Hat Linux)) id 1hiMaL-0005w3-Tk; Tue, 02 Jul 2019 17:28:54 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DCFE4207B53F0; Tue, 2 Jul 2019 19:28:51 +0200 (CEST) Date: Tue, 2 Jul 2019 19:28:51 +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: <20190702172851.GA3436@hirez.programming.kicks-ass.net> References: <20190626224718.21973-1-subhra.mazumdar@oracle.com> <20190626224718.21973-3-subhra.mazumdar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190626224718.21973-3-subhra.mazumdar@oracle.com> 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, 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. This then leaves regular balancing, and for that we can fudge with can_migrate_task() and nr_balance_failed or something. And I also really don't want a second utilization tipping point; we already have the overloaded thing. I also still dislike how you never looked into the numa balancer, which already has peferred_nid stuff.