Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1846264yba; Thu, 25 Apr 2019 06:42:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/6OpA9Z8pccDWkLwos2ZO3skbypykKdCgvQjhrNgsfrZAtPdenumVKej+z3loaQyLP3+A X-Received: by 2002:a63:e22:: with SMTP id d34mr32036956pgl.251.1556199746349; Thu, 25 Apr 2019 06:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556199746; cv=none; d=google.com; s=arc-20160816; b=OonDKe2SkuU6KyRN8lwRe0cu2YK5Dvieg9U3p3vlYmS+yBjTJIiF437DjU0RJiU6MU mfxo1SJCDEyPNKSXR988l6tuVsp3Zr/XtHCjISLk6e80of+WDJaZvExE1HmJeyT+3BnB lIkb2UlbInNVBmuYa+AR0oC1mRR+C2aWY2/G4KqPjfdY5cwh5iwcEvcfvDbYaVyU4n2h ML7MAHvO+s8mnxEglOiYK3X/7VFr8COBdyOzl7QG7mi5mR8y900Q5xu8QlprXqDkTJRX vNL32BczzMwGPI3IwDDojf86xFZkLcXADkIi9//hQThKkjYbwEkpbyqQ4rDzTpumnggH CuFw== 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:dkim-signature; bh=+KcJVtUHCKkeXtUPx4DbmASlTl2bIcZX2VLuly28cCU=; b=UXVcP8Agz6A9ImIOcevWtAJ13hMUnnByi/e0I1Ea/NBGCrXPFpkcXzPliJZaDMXrRf 9x7KDJVMr01vOq2ya4KCHy8zNibtBOW3KZUKWT5cKJcUOZTx666+zGsxbJbyVSPqN4w5 97tDSNZV4OrKx6sdK1OZc2QsMhRdaiGXaeW8Qvoc4838SjMc6aaivKFixV+xVlOjiVCp bAJ1NC5WZJNfpaeWzOlW+SSuSZ4b2EWYL3F5SGtB33q8wiu+AMPElAV7adY1cpE6iExm n9eLfB4O7Kb8tZ3HcxupOcfAOrHNe9i7wytZjIsIIzV/6RBtHTkyM11dzfPXx2N66BjV 7rUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=NwqMky3W; 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 t18si8272967plr.71.2019.04.25.06.42.11; Thu, 25 Apr 2019 06:42:26 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=NwqMky3W; 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 S2387679AbfDYL40 (ORCPT + 99 others); Thu, 25 Apr 2019 07:56:26 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60796 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387500AbfDYL4Y (ORCPT ); Thu, 25 Apr 2019 07:56:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+KcJVtUHCKkeXtUPx4DbmASlTl2bIcZX2VLuly28cCU=; b=NwqMky3Wy9bs0qG4uzAsAcVFV lGhyBJi6f2xeq7zn8d/O7bXqYd/urw3myNT7CZwqCVealx4ciWDDRDi+5WJxegQ5E60eV8nUzMZjY VB45vD5D5oCNgyRbuGobwFN/qVmXdCeXkwygtYe7+sCtR1c+T06ih0Z8yd/uB1y3waCq+LfAEaixc 73oN34ZuyRypX0lm7WmayrLPzbanYXBaknl6FYp79YrX9SE43iR9vK3ssrzmWNQtacJdGcyt5mGpJ Nm7pkIQ+EfxLImZgsZxV0A51iuBqcSEBESfCC1g+fL3Y6/g65JWvyjbJtQHOaXpPLOQPhRQ4yrvVX y4a14LQcQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJczG-0007qF-8q; Thu, 25 Apr 2019 11:56:22 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A09A020D0A201; Thu, 25 Apr 2019 13:56:20 +0200 (CEST) Date: Thu, 25 Apr 2019 13:56:20 +0200 From: Peter Zijlstra To: Nicholas Piggin Cc: Thomas Gleixner , Frederic Weisbecker , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/sched: run nohz idle load balancer on HK_FLAG_MISC CPUs Message-ID: <20190425115620.GQ4038@hirez.programming.kicks-ass.net> References: <20190412042613.28930-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412042613.28930-1-npiggin@gmail.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 Fri, Apr 12, 2019 at 02:26:13PM +1000, Nicholas Piggin wrote: > The nohz idle balancer runs on the lowest idle CPU. This can > interfere with isolated CPUs, so confine it to HK_FLAG_MISC > housekeeping CPUs. > > HK_FLAG_SCHED is not used for this because it is not set anywhere > at the moment. This could be folded into HK_FLAG_SCHED once that > option is fixed. Frederic? Anyway, I thnk I'll take this patch as is. Thanks! > The problem was observed with increased jitter on an application > running on CPU0, caused by nohz idle load balancing being run on > CPU1 (an SMT sibling). > > Signed-off-by: Nicholas Piggin > --- > kernel/sched/fair.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index fdab7eb6f351..d29ca323214d 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9522,22 +9522,26 @@ static inline int on_null_domain(struct rq *rq) > * - When one of the busy CPUs notice that there may be an idle rebalancing > * needed, they will kick the idle load balancer, which then does idle > * load balancing for all the idle CPUs. > + * - HK_FLAG_MISC CPUs are used for this task, because HK_FLAG_SCHED not set > + * anywhere yet. > */ > > static inline int find_new_ilb(void) > { > - int ilb = cpumask_first(nohz.idle_cpus_mask); > + int ilb; > > - if (ilb < nr_cpu_ids && idle_cpu(ilb)) > - return ilb; > + for_each_cpu_and(ilb, nohz.idle_cpus_mask, > + housekeeping_cpumask(HK_FLAG_MISC)) { > + if (idle_cpu(ilb)) > + return ilb; > + } > > return nr_cpu_ids; > } > > /* > - * Kick a CPU to do the nohz balancing, if it is time for it. We pick the > - * nohz_load_balancer CPU (if there is one) otherwise fallback to any idle > - * CPU (if there is one). > + * Kick a CPU to do the nohz balancing, if it is time for it. We pick any > + * idle CPU in the HK_FLAG_MISC housekeeping set (if there is one). > */ > static void kick_ilb(unsigned int flags) > { > -- > 2.20.1 >