Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbdFTTHj convert rfc822-to-8bit (ORCPT ); Tue, 20 Jun 2017 15:07:39 -0400 Received: from mout.gmx.net ([212.227.17.21]:52715 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbdFTTHi (ORCPT ); Tue, 20 Jun 2017 15:07:38 -0400 Message-ID: <1497985608.18887.62.camel@gmx.de> Subject: Re: [PATCH 3/3] sched: Spare idle load balancing on nohz_full CPUs From: Mike Galbraith To: Rik van Riel , Frederic Weisbecker , Peter Zijlstra Cc: LKML , Thomas Gleixner , Ingo Molnar Date: Tue, 20 Jun 2017 21:06:48 +0200 In-Reply-To: <1497980547.20270.106.camel@redhat.com> References: <1497838322-10913-1-git-send-email-fweisbec@gmail.com> <1497838322-10913-4-git-send-email-fweisbec@gmail.com> <1497980547.20270.106.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:Hi1DVvH9Yn5laEE5IXgtX/8hcwNmpTz600WGwEkGerSZWLOm4Ee BWeWQvkL2WIn7q6FICTWcmo940H9V6mpsVmo//ZiyIdMAocEqwBUEd7m5grm2EqQaNqn5Ki 2/jssO3ZUTewBDBdt1F2yBQrw4oDsDLdi0BCUTMdhJ8PBq52fn3LTk/YBZSGxKod4t563g/ Ds+l5Gxs6irNeeWoNAtiw== X-UI-Out-Filterresults: notjunk:1;V01:K0:YbIrkqGQ5jQ=:oIiI4ri91V7R8Mb7AA29cz 1m/u34sPfilZc/TcwQUERYFhC4bc868Ey2oFZW6ulI3mTkjqdm6s901YY79ZoxR5C1cipaTvl OtEjmlJRcsKvbmH95NDe/8LELPAyF3jsvC3R1X0uh4QivysoJ1/kBmed46HVrH9gIA/BDKUzK Qo4E5m8QSC2vMKS9EbT4hgUFKT+tUpOwBTGKuk3uxRQaeYiPhh6/RqZNc3534Zli8PQeHxigk EjEmW2wPBNnPk2Dh5L3lwthKOBwfaLYPx0x3vfspVSwJyiqUlg5Z3V332RgE2rAnL49ED+H+Q JJC+jLzBignRs/JtHKeXF4S+KjprSwpwntL6f+oGt5+fx/rJTfwYxmX70a/MjbAudp/gouCwD DgoLV8ZAuds+XEb0ngljaIjEPWmrtbyqNjYyMkRePJ9OErKgNJtYLo3XvabufLoa2CqsJdChC YJacfhE2SutiL54vneovsHLR7fItU5PPH38OJUaSkyUGmVJVXDPubbr+6pLLXN6GWOBjUZKEv LvnatnMMqKRL/5LdA72+oWPVh54cXWYMO+K9mPYhBpE5Bofy5DguII/26EZHZ4H4WJeHLnYzD bzYGsSGGYQJepTWqJ8xnwL3XwON994RepAQ1gePbFI3LV0oSptBz/AZk0msRs6KAxz+/jwOZd ModnIuYoFQ+lIaYIBxZBMXX2FgsUNv/3R+hGIsW0+AqY+S5E5i3w/oaHSBUqPj87abuqvgJ+u kiLfMww+An12MAQd7IT1gEpy03R9axCvuF0B8QFnUY6phsxh6aS/A0z81TljIuz+tVfwujhkL J/sPncn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2328 Lines: 61 On Tue, 2017-06-20 at 13:42 -0400, Rik van Riel wrote: > On Mon, 2017-06-19 at 04:12 +0200, Frederic Weisbecker wrote: > > Although idle load balancing obviously only concern idle CPUs, it can > > be a disturbance on a busy nohz_full CPU. Indeed a CPU can only get > > rid > > of an idle load balancing duty once a tick fires while it runs a task > > and this can take a while in a nohz_full CPU. > > > > We could fix that and escape the idle load balancing duty from the > > very > > idle exit path but that would bring unecessary overhead. Lets just > > not > > bother and leave that job to housekeeping CPUs (those outside > > nohz_full > > range). The nohz_full CPUs simply don't want any disturbance. > > > > Signed-off-by: Frederic Weisbecker > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: Rik van Riel > > Cc: Peter Zijlstra > > --- > >  kernel/sched/fair.c | 4 ++++ > >  1 file changed, 4 insertions(+) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index d711093..cfca960 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -8659,6 +8659,10 @@ void nohz_balance_enter_idle(int cpu) > >   if (!cpu_active(cpu)) > >   return; > >   > > + /* Spare idle load balancing on CPUs that don't want to be > > disturbed */ > > + if (!is_housekeeping_cpu(cpu)) > > + return; > > + > >   if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu))) > >   return; > > I am not entirely convinced on this one. > > Doesn't the if (on_null_domain(cpu_rq(cpu)) test > a few lines down take care of this already? > > Do we want nohz_full to always automatically > imply that no idle balancing will happen, like > on isolated CPUs? IMO, nohz_full capable CPUs that are not isolated should automatically become housekeepers, and nohz_full _active_ upon becoming isolated.  When a used as a housekeeper, you still pay a price for having the nohz_full capability available, but it doesn't have to be as high.  In my kernels, I use cpusets to turn nohz on/off set wise, so CPUs can be ticking, dyntick, nohz_full or housekeeper, RT load balancing and cpupri on/off as well if you want to assume full responsibility.  It's a tad (from box of xxl tads) ugly, but more flexible. -Mike