Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5235483pxj; Wed, 26 May 2021 06:08:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1asWwLTE0gsSL9Sc0cW1mGvNuhF5pHQeCscg+rfaemKN5sf5yumBy3w5NIc0BW1RDRR8r X-Received: by 2002:adf:fd89:: with SMTP id d9mr17060261wrr.52.1622034501919; Wed, 26 May 2021 06:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622034501; cv=none; d=google.com; s=arc-20160816; b=UAo83iJuqgRAPzumScgKZkzc2/PYjKXuSQgVEK1dPAYReIzFZ6noKfSPUowCLmoLXt R/DioBkI/MIsNt3G4301Abi8Lgr1I9lFfHDWG4wm2RqLZ4AwgAZz1BLsIhtQq2EsyeFh 4mzR1jZZe3Ymu77eszDAC4PY2ByuXvYoFoOdCBdgq8sCgxjxRPLl7k1RT2J+kyOVui8T w78yuT2sR1h+BROwCvJ/1Bx9RFd5oBEZzBH9N03LARX3yHtltbau36X2U9qMlsdtxVPl 0IN/wgAxlaFJAocoidaLiHSKW/duGru+4wkx/ZNAq+4zQaWbeXKUAioipcN1z3IjsrXr j8cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E3xmH7qSYyi3hV73rc2x1wNehlEhuf3efAfgA0/Hbw8=; b=ZcLFnhM++/P02UTz4C37W8x2j/7mGNCE9++H+84col2pSUMRTjBfhM7iqq3SvKNzc2 Ujj94g9Kj6Nt+S1AvKTiHqFh9+yCuq2Mbw82Zn1mUIZ8p31VyHR3ubbUJUeSnq0QGYhr G+pofSVnjfiBRRISG2k1avPxXJCzajuwoF0z0NUSzR6CSrXHtLPLkfXopWuHaBgHD/hV Ik7P9DZwYXkVk5u7Fh4X4iQeOwOH5dWkdLZ7vsWVjiSlJbC/vcpywDk0RB98B8CSa4Hp EjGzV0zheZwxIkfn+k/BtudByaieftzQCn476MhboxPW47d7RJmxOqKNJukc/kx458oT Dyhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BGNJ1Qwa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si17893412eda.470.2021.05.26.06.07.55; Wed, 26 May 2021 06:08:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BGNJ1Qwa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233870AbhEZMR5 (ORCPT + 99 others); Wed, 26 May 2021 08:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233889AbhEZMR4 (ORCPT ); Wed, 26 May 2021 08:17:56 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F006EC061761 for ; Wed, 26 May 2021 05:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=E3xmH7qSYyi3hV73rc2x1wNehlEhuf3efAfgA0/Hbw8=; b=BGNJ1Qwazv6vVbt4FmD6tNlfNC 6pTn5N/oqp17QPS2Ix8oduopj1QpX/8aR3NgvWPjKuPm+6nJFIVrf9+b2lBv/JnXqOIx00L9ho4Tl UDHR7SJDPaFE+QLbxUM6d7tsBT9ApohrCfGWkNkdgmeRMytguHMYlszRlk3Aai52lQS+OMjc1smV9 b7n/vyJfTot7TZlSKUw874QJLxR/waqr7H1iT3QjcZ0Q/HzHn30g1BZIOxZZtgyaslwSoCk3i1TD1 L+mv1XHyq2jPzmU4pgKKmxdsHy6JVu1SR64f9XK8ey5l7yqQLhSxsTicWzLRPjGKoROWkKIYejglC pERWbfqA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1llsRb-000dfV-7b; Wed, 26 May 2021 12:15:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F070830022C; Wed, 26 May 2021 14:15:31 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A872C20567627; Wed, 26 May 2021 14:15:31 +0200 (CEST) Date: Wed, 26 May 2021 14:15:31 +0200 From: Peter Zijlstra To: Barry Song Cc: vincent.guittot@linaro.org, mingo@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, valentin.schneider@arm.com, juri.lelli@redhat.com, bristot@redhat.com, linux-kernel@vger.kernel.org, guodong.xu@linaro.org, yangyicong@huawei.com, tangchengchang@huawei.com, linuxarm@huawei.com Subject: Re: [PATCH] sched: fair: don't depend on wake_wide if waker and wakee are already in same LLC Message-ID: References: <20210526091057.1800-1-song.bao.hua@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210526091057.1800-1-song.bao.hua@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org $subject is weird; sched/fair: is the right tag, and then start with a capital letter. On Wed, May 26, 2021 at 09:10:57PM +1200, Barry Song wrote: > when waker and wakee are already in the same LLC, it is pointless to worry > about the competition caused by pulling wakee to waker's LLC domain. But there's more than LLC. > Signed-off-by: Barry Song > --- > kernel/sched/fair.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 3248e24a90b0..cfb1bd47acc3 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6795,7 +6795,15 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags) > new_cpu = prev_cpu; > } > > - want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr); > + /* > + * we use wake_wide to make smarter pull and avoid cruel > + * competition because of jam-packed tasks in waker's LLC > + * domain. But if waker and wakee have been already in > + * same LLC domain, it seems it is pointless to depend > + * on wake_wide > + */ > + want_affine = (cpus_share_cache(cpu, prev_cpu) || !wake_wide(p)) && > + cpumask_test_cpu(cpu, p->cpus_ptr); > } And no supportive numbers...