Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp595417pxk; Wed, 16 Sep 2020 11:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9blHmMQEAUobxtHEIj7mlaM18eANssm+vZZq4VxclkC8r3JyDqsZxWqjVLIaEVU6an7jz X-Received: by 2002:a17:906:d9da:: with SMTP id qk26mr26424159ejb.435.1600281854547; Wed, 16 Sep 2020 11:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600281854; cv=none; d=google.com; s=arc-20160816; b=y90E9/9rL3bIYAixW7anUFqcvjFsId6fPeYPPTo5PrCRxZyCyc7S+8MIlhzTphg0t6 L2t6lRSamQIBDXPCoKGtHc/BSiqTBfIZ2not/QrElrqtwssqoHm9FyQhJWZ4NIvmByLs uFWb/fvpHQrQcs2SCGj3kt4qzRTfAoU8iRfKmeAtheHPaCEH1XkI3Uf4AJBk1ugksbm3 x+PoCadl+ybhAi5+LmI+3K6WJVf5IKygmJ9ifZapTFRwNxyjchDZUx/b+2irvilN1qDX Rt+mlx4pg5qdYYutbgvSVfr5TAJyBmN0G3dLCfKodXBiBFmK33qB92ZwJrUiDSCeXdIm hp6Q== 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; bh=50eF47TB+sBlMeVhZNe/Er6OmY9QSilB3oOiZBoPUF4=; b=r5JWmM+KscFX6wiUsNXGMEtMzY8KG2kOEykj3tzDizn+83HzZTyeasSj6BDpKp8PkL 4inphvB7/5QRgBfZOUqoNc1pHESbZtA8btPiFajAksLxL65g+rbr4yaHzc9ie5eJ4Ql2 sVB+GntvbDQcLIdjV2H5MmW4jCkmrw8RBAkej+bXgwvx6ySvMgRgq8pRJtPjFxS5oInk MNamUALXZSFAeq7ysDHa9jZdT9XxWxLHtgjaENZP3DetPCrBtOLdZF1YNy69xHQSaW32 dTgCyCr7E+UqrzXMq1xOYFeIHBy3Z8qD9V/lEIoGIPNsI14tYd9Coiaj9oNJsLXMbWAR tSSQ== 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 m27si12297145ejb.476.2020.09.16.11.43.51; Wed, 16 Sep 2020 11:44:14 -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 S1727830AbgIPSnR (ORCPT + 99 others); Wed, 16 Sep 2020 14:43:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:37910 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727972AbgIPSXn (ORCPT ); Wed, 16 Sep 2020 14:23:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 01D57AC24; Wed, 16 Sep 2020 11:00:58 +0000 (UTC) Date: Wed, 16 Sep 2020 12:00:39 +0100 From: Mel Gorman To: Aubrey Li Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, valentin.schneider@arm.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, Qais Yousef , Jiang Biao Subject: Re: [RFC PATCH v2] sched/fair: select idle cpu from idle cpumask in sched domain Message-ID: <20200916110039.GG3117@suse.de> References: <20200916043103.606132-1-aubrey.li@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20200916043103.606132-1-aubrey.li@linux.intel.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, Sep 16, 2020 at 12:31:03PM +0800, Aubrey Li wrote: > Added idle cpumask to track idle cpus in sched domain. When a CPU > enters idle, its corresponding bit in the idle cpumask will be set, > and when the CPU exits idle, its bit will be cleared. > > When a task wakes up to select an idle cpu, scanning idle cpumask > has low cost than scanning all the cpus in last level cache domain, > especially when the system is heavily loaded. > > The following benchmarks were tested on a x86 4 socket system with > 24 cores per socket and 2 hyperthreads per core, total 192 CPUs: > This still appears to be tied to turning the tick off. An idle CPU available for computation does not necessarily have the tick turned off if it's for short periods of time. When nohz is disabled or a machine is active enough that CPUs are not disabling the tick, select_idle_cpu may fail to select an idle CPU and instead stack tasks on the old CPU. The other subtlety is that select_idle_sibling() currently allows a SCHED_IDLE cpu to be used as a wakeup target. The CPU is not really idle as such, it's simply running a low priority task that is suitable for preemption. I suspect this patch breaks that. -- Mel Gorman SUSE Labs