Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp3164789pxy; Wed, 4 Aug 2021 04:06:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz85mSVKIi1L4XdVqwibYSxz9KieaRQu/U/54u5NibPPdlCJYD5LCDtqtbNK77emdB4haBg X-Received: by 2002:a17:906:a2c4:: with SMTP id by4mr25603515ejb.521.1628075194731; Wed, 04 Aug 2021 04:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628075194; cv=none; d=google.com; s=arc-20160816; b=D53kV/6WG5vBMi+y5qluWxE9788LSjT3OihUl93x1acDfw7myMccVmmziMvmlYYrac 4DOxWNsdL+4wMhBHdfr4VZcbyDWTx+A/wTD/rXOCvgORshvN7Vh8Y3tt0ZRQ4GwOUua4 tgbpgYuGG4Lc9O9fxLdoX4BaqX9BtGv5iYN0iHa56evzLjlV+18DZplDE4ru+eRCOki4 7qrOu0svYge2jgwCevoFdXUXseWTOctHVUAjGH2lqKFRwMA9uK1O3c0MKRiSqn+K5KxB 8v5ZDqtJ2CMuQa0R4Fdu0++voLSFA4Dab6DsbUpexbDTi5nhWSgcNIOdSC1U95tX1A9N 19GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=izWMAZ60YYQyki1g/NqxK0h6e1EXUog4z5LDdpUBCqk=; b=PHHPpbDvr2CYpJ2briwK5QGKh6+VeGPKltzVuhJOjNwkMsiEI5f9PV5hD1MqyH0hEp UPgp2W6QoADI7l+gb1t3nnrH9EWrP6qste2keTGCIdhPuu43U6jCdERs/98DHyeLZLe1 y9kQvcWouAJdqbLdBqlRkaKJYaK0gNRiNzWHd9UyUhHbn9ml/w4nuwNlFjrIwhv0A4GY MlWzE94ik4ngk2G/iglsmWmkDi4opAF7Shzu6jcNoQoLkC9GFKEUgEtgnnYw2NzZdlf4 hEtYB61g2Zms/TrRmqa3ex3rOnMdE60CLD6awc0uAyWSexKJHbTiyIpIT5F65RKpUOVd Q5Qw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx24si1832617ejc.66.2021.08.04.04.06.08; Wed, 04 Aug 2021 04:06:34 -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; 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 S237213AbhHDKWv (ORCPT + 99 others); Wed, 4 Aug 2021 06:22:51 -0400 Received: from outbound-smtp61.blacknight.com ([46.22.136.249]:33327 "EHLO outbound-smtp61.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235522AbhHDKWv (ORCPT ); Wed, 4 Aug 2021 06:22:51 -0400 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp61.blacknight.com (Postfix) with ESMTPS id 0E485FAA38 for ; Wed, 4 Aug 2021 11:22:38 +0100 (IST) Received: (qmail 3488 invoked from network); 4 Aug 2021 10:22:37 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 4 Aug 2021 10:22:37 -0000 Date: Wed, 4 Aug 2021 11:22:36 +0100 From: Mel Gorman To: "Song Bao Hua (Barry Song)" Cc: LKML , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Valentin Schneider , Aubrey Li , yangyicong Subject: Re: [PATCH 7/9] sched/fair: Enforce proportional scan limits when scanning for an idle core Message-ID: <20210804102236.GB6464@techsingularity.net> References: <20210726102247.21437-1-mgorman@techsingularity.net> <20210726102247.21437-8-mgorman@techsingularity.net> <58167022b9074ed9951b09ab6ba1983e@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <58167022b9074ed9951b09ab6ba1983e@hisilicon.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 10:52:01AM +0000, Song Bao Hua (Barry Song) wrote: > > @@ -6265,30 +6265,35 @@ static int select_idle_cpu(struct task_struct *p, struct > > sched_domain *sd, bool > > if (has_idle_core) { > > i = select_idle_core(p, cpu, cpus, &idle_cpu); > > if ((unsigned int)i < nr_cpumask_bits) > > - return i; > > + break; > > > > + nr -= sched_smt_weight; > > } else { > > - if (!--nr) > > - return -1; > > idle_cpu = __select_idle_cpu(cpu, p); > > if ((unsigned int)idle_cpu < nr_cpumask_bits) > > break; > > + nr--; > > } > > + > > + if (nr < 0) > > + break; > > } > > > > - if (has_idle_core) > > - set_idle_cores(target, false); > > + if ((unsigned int)idle_cpu < nr_cpumask_bits) { > > + if (has_idle_core) > > + set_idle_cores(target, false); > > > > For example, if we have 16 cpus(8 SMT2 cores). In case core7 is idle, > we only have scanned core0+core1(cpu0-cpu3) and if these two cores > are not idle, but here we set has_idle_cores to false while core7 is > idle. It seems incorrect. > Yep, that block needs to be revisited. -- Mel Gorman SUSE Labs