Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1099375ybx; Wed, 30 Oct 2019 09:50:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEzLWyDmU9C/uPvok0iuaq6oXFFpPyxDiEm2f+cxYAsQLjajDnTsZmVzUc/+WGVVg8wEc0 X-Received: by 2002:a17:906:1e07:: with SMTP id g7mr525167ejj.256.1572454256535; Wed, 30 Oct 2019 09:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572454256; cv=none; d=google.com; s=arc-20160816; b=UdPoQAuJAUVOVAvU3BTv15Mn+LNuBO1EETv9w9aIQ039Qqm8GJ2RaatzUUmTo9YHlZ zrQs0BWem57638mzr1D8Mm8k0IG7ECp/tLE4gwyKAq+1ke/dFPSXWmteMfhRRB8eoVgO wmwAcw5b+PPRMDNLd8nqltnkeRXk9ULB6cQsw5LP0tVt0kmfOdt62DWokzD7Tqxs/ElO p5UFaVuzsnlkjfQDqNcTLUIpoBHPXcR1122OHeZuzfQMOtjEwD0TVvcuD4e7I1Syepo4 fJw9JCGA9fdNKR6DJryEbw6sE011iqn/2puP3IvrR8BS8U9yfRaEb5NWAxEc5w/klNZ2 PO9Q== 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=zXeAalpNjPUW6uuWyaGYDMl23e5k1y4OBH4FjHIeAYg=; b=on/Zop6yvgbvvNUoP7faWomOZ+3AqiZgf4OA/XCUrjLIKq2NjXck07xmT3Tub9e3Dm BHbQNV1mXa1TkUERrhN+JAqDvoOZAIL3Ffmd+gIJ56UOa3keGmLTRmMaGEnhOXzrPZbT 5irixRu0JwhuuE2rpx6287OPyYAKfx8SOCyuBrL2GzOyBqAN/Lzibiz5gybcAXeak+/d aGg0knKQ49sUdJseYr02YTkdxwZrjsloO0/0iRD0H/Sif0s1pkpH/m3zJnT81o2lkG3w 4xRobgkQUTnxOigiGBdbnk1Ku+8od54FA8MdchMzi/bIW2F3/hHMKL6h0CKbRg/KERZB 4c9A== 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 b18si1790447eda.307.2019.10.30.09.50.32; Wed, 30 Oct 2019 09:50:56 -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 S1727009AbfJ3QrS (ORCPT + 99 others); Wed, 30 Oct 2019 12:47:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:36424 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726626AbfJ3QrS (ORCPT ); Wed, 30 Oct 2019 12:47:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6FEAEB3E2; Wed, 30 Oct 2019 16:47:16 +0000 (UTC) Date: Wed, 30 Oct 2019 16:47:14 +0000 From: Mel Gorman To: Viresh Kumar Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Make sched-idle cpu selection consistent throughout Message-ID: <20191030164714.GH28938@suse.de> References: <5eba2fb4af9ebc7396101bb9bd6c8aa9c8af0710.1571899508.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5eba2fb4af9ebc7396101bb9bd6c8aa9c8af0710.1571899508.git.viresh.kumar@linaro.org> 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 Thu, Oct 24, 2019 at 12:15:27PM +0530, Viresh Kumar wrote: > There are instances where we keep searching for an idle CPU despite > having a sched-idle cpu already (in find_idlest_group_cpu(), > select_idle_smt() and select_idle_cpu() and then there are places where > we don't necessarily do that and return a sched-idle cpu as soon as we > find one (in select_idle_sibling()). This looks a bit inconsistent and > it may be worth having the same policy everywhere. > This needs supporting data. find_idlest_group_cpu is generally from a fork() context where it's not particularly performance critical. select_idle_sibling and the helpers it uses is wakeup context where is is often much more critical to wake quickly than find the best CPU. The biggest challenge of select_idle_sibling is making a "good enough decision" quickly without disrupting cache but a fork-intensive workload making quick decision can overload local domains requiring fixing by the load balancer. > On the other hand, choosing a sched-idle cpu over a idle one shall be > beneficial from performance point of view as well, as we don't need to > get the cpu online from a deep idle state which is quite a time > consuming process and delays the scheduling of the newly wakeup task. > > This patch tries to simplify code around sched-idle cpu selection and > make it consistent throughout. > > FWIW, tests were done with the help of rt-app (8 SCHED_OTHER and 5 > SCHED_IDLE tasks, not bound to any cpu) on ARM platform (octa-core), and > no significant difference in scheduling latency of SCHED_OTHER tasks was > found. > As the patch stands, I think a fork-intensive workload where each process is doing small amounts of work will suffer from overloading domains and have variable performance depending on how quickly the load balancer reacts. -- Mel Gorman SUSE Labs