From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755379AbdLTODS (ORCPT ); Wed, 20 Dec 2017 09:03:18 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:43942 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362AbdLTODP (ORCPT ); Wed, 20 Dec 2017 09:03:15 -0500 Date: Wed, 20 Dec 2017 15:03:06 +0100 From: Peter Zijlstra To: Brendan Jackman Cc: Vincent Guittot , Dietmar Eggemann , Ingo Molnar , linux-kernel@vger.kernel.org, Ingo Molnar , Morten Rasmussen Subject: Re: [PATCH v2 1/2] sched: force update of blocked load of idle cpus Message-ID: <20171220140306.egxub7sog4il2plm@hirez.programming.kicks-ass.net> References: <20171201180157.18937-1-brendan.jackman@arm.com> <20171201180157.18937-2-brendan.jackman@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171201180157.18937-2-brendan.jackman@arm.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 01, 2017 at 06:01:56PM +0000, Brendan Jackman wrote: > @@ -8955,8 +8964,20 @@ static void nohz_balancer_kick(void) > if (ilb_cpu >= nr_cpu_ids) > return; > > - if (test_and_set_bit(NOHZ_BALANCE_KICK, nohz_flags(ilb_cpu))) > + if (test_and_set_bit(NOHZ_BALANCE_KICK, nohz_flags(ilb_cpu))) { > + if (!only_update) { > + /* > + * There's a pending/ongoing nohz kick/balance. If it's > + * just for stats, convert it to a proper load balance. > + */ > + clear_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu)); > + } > return; > + } > + > + if (only_update) > + set_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu)); > + > /* > * Use smp_send_reschedule() instead of resched_cpu(). > * This way we generate a sched IPI on the target cpu which This looks racy.. if its not we don't need atomic ops, if it is but is still fine it needs a comment.