Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp403759pxu; Fri, 4 Dec 2020 06:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJydl1d2IrnwCi7nak7+Ysl+ZJJ6H/x/mge32NificA21lYL4VRKgU0MgKr4kYlJ0Xr5amog X-Received: by 2002:a50:a40f:: with SMTP id u15mr8063072edb.307.1607091236535; Fri, 04 Dec 2020 06:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607091236; cv=none; d=google.com; s=arc-20160816; b=H9kcabVVNwGz/M4bUTHJHX9sr5WCg5KEgihWRbgjAENoBxeG09xxsnRoAy1BZwuf5V nWbKoaunzMuZW5Ax90sErmLNP6Hw/dpZ2CpDZu6uyBZlpKjZmYnxHkDf6S1StreiAfqE srwKoHWi3ol7EE8t4zaFCLoAME8eXbYvC/eq/E7EnAH1y+jmwWLYEayFp0jeY9nEBnXz cKfcLdc6H2Iez8Tl2EWjs8NESNIQWJCDzAq8WbYobJO1jtxCf/LgwiJeSvt9ju5oira5 oJf96m2AMk45QbPZJ/A6laM7gVwsaoE1G9GtUFvE7QxuLSLQNPIEBBqruo4Ehmrnd8eR ZVbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=2HddR6jAcdHEMRs28jUFnm9yXXa49Sg2S9vFG9TcvE0=; b=W7p7DAFca2npNffY4b/teNsSvTCjmLGVY9jhsfAEd36t7vdWKhN6X04UyiDoFWnOIT obBERwUi9/g8nNtAhy/+PHBRg36fQ6IpT4SRUuoTwg9jSCkoqop6G4mWTJwDwsb6TDR3 wFLoWo/vANEKxKEMdpdVvK8YfiWc5VeLFk15fk1ccdDaO4ESgLge014NFgYOzb/NTYLR 6cbIjSwzICjoy2bpndxaxvzYAhQuAo9aRBb90a1OKAw6KGkc3ylQ0u0GC9v82Fi0clOO 4bVylZyntJSCNOcRsgc/kWxwvRPjVvSCAhrnoI6lf+uRR+yb3v7xBY/D74xTJzmct8YP F/vQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si2951323edx.114.2020.12.04.06.13.26; Fri, 04 Dec 2020 06:13:56 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388251AbgLDOJ1 (ORCPT + 99 others); Fri, 4 Dec 2020 09:09:27 -0500 Received: from mga09.intel.com ([134.134.136.24]:33105 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387521AbgLDOJ1 (ORCPT ); Fri, 4 Dec 2020 09:09:27 -0500 IronPort-SDR: cmnlImSLDkfvBGtOzRA/ct5Hqlp2aRSNhX1TDyUJ45OpMmPv68kGwz8F5rhq5mCv28yiCADZAZ YTMC6m8yyTTA== X-IronPort-AV: E=McAfee;i="6000,8403,9824"; a="173535101" X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="173535101" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2020 06:07:40 -0800 IronPort-SDR: HYc2YFZuDUXZsax1YtsqoB3hL1pubb2L2WVFYvT4F7/onrViWRARky0b7iuLRWM7Cq/dMn01v0 WhFI7htq/gJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="374356951" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.125]) ([10.239.161.125]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2020 06:07:14 -0800 Subject: Re: [PATCH 06/10] sched/fair: Clear the target CPU from the cpumask of CPUs searched To: Vincent Guittot Cc: Mel Gorman , LKML , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Valentin Schneider , Linux-ARM References: <20201203141124.7391-1-mgorman@techsingularity.net> <20201203141124.7391-7-mgorman@techsingularity.net> <20201203175204.GY3371@techsingularity.net> <20201204113030.GZ3371@techsingularity.net> <3d8a6d19-afac-dc93-127d-da6505402cdf@linux.intel.com> From: "Li, Aubrey" Message-ID: Date: Fri, 4 Dec 2020 22:07:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/4 21:47, Vincent Guittot wrote: > On Fri, 4 Dec 2020 at 14:40, Li, Aubrey wrote: >> >> On 2020/12/4 21:17, Vincent Guittot wrote: >>> On Fri, 4 Dec 2020 at 14:13, Vincent Guittot wrote: >>>> >>>> On Fri, 4 Dec 2020 at 12:30, Mel Gorman wrote: >>>>> >>>>> On Fri, Dec 04, 2020 at 11:56:36AM +0100, Vincent Guittot wrote: >>>>>>> The intent was that the sibling might still be an idle candidate. In >>>>>>> the current draft of the series, I do not even clear this so that the >>>>>>> SMT sibling is considered as an idle candidate. The reasoning is that if >>>>>>> there are no idle cores then an SMT sibling of the target is as good an >>>>>>> idle CPU to select as any. >>>>>> >>>>>> Isn't the purpose of select_idle_smt ? >>>>>> >>>>> >>>>> Only in part. >>>>> >>>>>> select_idle_core() looks for an idle core and opportunistically saves >>>>>> an idle CPU candidate to skip select_idle_cpu. In this case this is >>>>>> useless loops for select_idle_core() because we are sure that the core >>>>>> is not idle >>>>>> >>>>> >>>>> If select_idle_core() finds an idle candidate other than the sibling, >>>>> it'll use it if there is no idle core -- it picks a busy sibling based >>>>> on a linear walk of the cpumask. Similarly, select_idle_cpu() is not >>>> >>>> My point is that it's a waste of time to loop the sibling cpus of >>>> target in select_idle_core because it will not help to find an idle >>>> core. The sibling cpus will then be check either by select_idle_cpu >>>> of select_idle_smt >>> >>> also, while looping the cpumask, the sibling cpus of not idle cpu are >>> removed and will not be check >>> >> >> IIUC, select_idle_core and select_idle_cpu share the same cpumask(select_idle_mask)? >> If the target's sibling is removed from select_idle_mask from select_idle_core(), >> select_idle_cpu() will lose the chance to pick it up? > > This is only relevant for patch 10 which is not to be included IIUC > what mel said in cover letter : "Patches 9 and 10 are stupid in the > context of this series." So the target's sibling can be removed from cpumask in select_idle_core in patch 6, and need to be added back in select_idle_core in patch 10, :)