Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp487267ybg; Thu, 19 Mar 2020 03:31:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvH15CCKGH78EVtNsR6AKJM8SWQEtvayiyfROnN1KbBwp+sWwucl32r+J0vEpfc28kXXk+h X-Received: by 2002:aca:8ce:: with SMTP id 197mr1719347oii.35.1584613908821; Thu, 19 Mar 2020 03:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584613908; cv=none; d=google.com; s=arc-20160816; b=XFgGPS0evNzVhl/1vjvtvb+//2hisaZ+wbILtMT9OKHjFgQw0nzsbkZMgnIW1XC/XT Iw8DRALKHbB5+mPJzDndKR5uAm91RsxefNlEhyVqJKRs960ETwA7dpM2nJ3oiVockdwS Hc0E8eUJGMdZHUzm27o7agRQYpF4KK755cI+9LNNwO9XFZKtIDHpkBJJygXTTIJ8JYKQ 8CDUkCQQ3hgiq171q+hBq8Mq1kHKE5spPRrwMWRjy9+k7OKxAfbSoynA3wl8A0daGJ16 ESum7jaRiD1yoD6X5/E7+3yjMG/t/ZI/9eoCJRzhcu2REU3bKPmh07Pp3U3OGvqoCltH Z0wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=EG+d72TEwNl56DKCJP4DFEtvnaotFPF+THNSKAuY1B0=; b=Xvc7PvmhAGMn9OUsOQYK3Soy9wk7hPR6jzaPNcA9uj3TgLV++bPkAJEWZQ0EIlMZUn mWi71Aym9I3jqfmPcHf3Eas0J3wVlweP39IU0M8tiG16DQr3vmNohfPcjtVZECKOlK+6 1pAJhxpB8fUcstfrfZ4GK8ytpYfkDKIK3yIxq+VL14EYh3HgFH80GL/V1NyL7OXhrR13 ObU07bJiGNHUprLooYubhEIRicuAqCXANmfbx6mZN3KznHflVwRmJ1JbrvKP5lhYM5oL 5qRTb4YNl3f3Bhhz5zgV3XlE9Rdg9vTPy7JSgL04LSFBkn0eAM8K2GS7qlTr/F27/8Sq oEEA== ARC-Authentication-Results: i=1; mx.google.com; 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 b21si1063498otp.79.2020.03.19.03.31.29; Thu, 19 Mar 2020 03:31:48 -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; 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 S1727103AbgCSKaV (ORCPT + 99 others); Thu, 19 Mar 2020 06:30:21 -0400 Received: from foss.arm.com ([217.140.110.172]:33052 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgCSKaV (ORCPT ); Thu, 19 Mar 2020 06:30:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BE52A31B; Thu, 19 Mar 2020 03:30:20 -0700 (PDT) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B91653F305; Thu, 19 Mar 2020 03:30:19 -0700 (PDT) From: Dietmar Eggemann Subject: Re: [PATCH v2 8/9] sched/fair: Split select_task_rq_fair want_affine logic To: Valentin Schneider , linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org References: <20200311181601.18314-1-valentin.schneider@arm.com> <20200311181601.18314-9-valentin.schneider@arm.com> Message-ID: Date: Thu, 19 Mar 2020 11:30:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200311181601.18314-9-valentin.schneider@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.03.20 19:16, Valentin Schneider wrote: [...] > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index f98dac0c7f82..a6fca6817e92 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6620,26 +6620,33 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags) > } > > rcu_read_lock(); > + > + sd = highest_flag_domain(cpu, sd_flag); > + > + /* > + * If !want_affine, we just look for the highest domain where > + * sd_flag is set. > + */ > + if (!want_affine) > + goto scan; > + > + /* > + * Otherwise we look for the lowest domain with SD_WAKE_AFFINE and that > + * spans both 'cpu' and 'prev_cpu'. > + */ > for_each_domain(cpu, tmp) { > - /* > - * If both 'cpu' and 'prev_cpu' are part of this domain, > - * cpu is a valid SD_WAKE_AFFINE target. > - */ > - if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && > + if ((tmp->flags & SD_WAKE_AFFINE) && > cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { > if (cpu != prev_cpu) > new_cpu = wake_affine(tmp, p, cpu, prev_cpu, sync); > > - sd = NULL; /* Prefer wake_affine over balance flags */ > + /* Prefer wake_affine over SD lookup */ I assume that 'balance flags' stands for (wakeup) load balance, i.e. find_idlest_xxx() path. So why change it? [...]