From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C028C4338F for ; Tue, 24 Aug 2021 08:11:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E22DF61372 for ; Tue, 24 Aug 2021 08:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235288AbhHXIMj (ORCPT ); Tue, 24 Aug 2021 04:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234936AbhHXIMh (ORCPT ); Tue, 24 Aug 2021 04:12:37 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C06EFC061757 for ; Tue, 24 Aug 2021 01:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=T3mdjdXunlsbWXwGgryPRHDmOYktBKnLJTuTpTZcTpA=; b=coXP/mZ/BzITdG8+Z/+NlMTDsQ +Ypj6x8QLQcjHn+rnSePfN2jfVoCpzHk9hJmmQ3FYjve040rxsi9MBk4f4Vmk0L/EEk+dweTL53cQ oYYUZp/9MdwNtCpziGfS64fdH2CJMCUjmu3hluc7l2zfQ/v3l53bShjaZyHQn27LX0T9ufy95LoqW UrOO4U7ry+sTpVFm8Xa391c5et7EAOQFQ55OUCxhTbub6AQsqskxgUfeQGpdQWD0us5dXGY5R1TCW fCQNIW/GtFPYj7rVknsHJPMfSSqMk5ImccLjP383QKqjtvP6eDVdYnnRZnWrbZRVcHNf4cEcbH3Y5 2ZwyKPuA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIRXA-00CXMu-IC; Tue, 24 Aug 2021 08:11:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5FB6C300399; Tue, 24 Aug 2021 10:11:46 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C739220CCE56B; Tue, 24 Aug 2021 10:11:46 +0200 (CEST) Date: Tue, 24 Aug 2021 10:11:46 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: Valentin Schneider , linux-kernel@vger.kernel.org, Vincent Guittot , Ingo Molnar Subject: Re: [PATCH v3 1/2] sched/fair: Add NOHZ balancer flag for nohz.next_balance updates Message-ID: References: <20210823111700.2842997-1-valentin.schneider@arm.com> <20210823111700.2842997-2-valentin.schneider@arm.com> <87fsv02u9h.mognet@arm.com> <99b4c9d6-d20c-bc94-58c0-c1f5249b2636@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99b4c9d6-d20c-bc94-58c0-c1f5249b2636@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021 at 03:53:16PM +0200, Dietmar Eggemann wrote: > >> I'm a bit puzzled by this; that function has: > >> > >> SCHED_WARN_ON((flags & NOHZ_KICK_MASK) == NOHZ_BALANCE_KICK); > >> > >> Which: > >> > >> - isn't updated > >> - implies STATS must be set when BALANCE > > > > Yup > > > >> > >> the latter gives rise to my confusion; why add that gate on STATS? It > >> just doesn't make sense to do a BALANCE and not update STATS. > > > > AFAIA that warning was only there to catch BALANCE && !STATS, so I didn't > > tweak it. > > > > Now, you could still end up with > > > > flags == NOHZ_NEXT_KICK > > > > (e.g. nohz.next_balance is in the future, but a new CPU entered NOHZ-idle > > and needs its own rq.next_balance collated into the nohz struct) > > > > in which case you don't do any blocked load update, hence the > > gate. In v1 I had that piggyback on NOHZ_STATS_KICK, but Vincent noted > > that might not be the best given blocked load updates can be time > > consuming - hence the separate flag. > > Maybe the confusion stems from the fact that the NOHZ_NEXT_KICK-set > changes are only introduced in 2/2? > > @@ -10417,6 +10418,9 @@ static void nohz_balancer_kick(struct rq *rq) > unlock: > rcu_read_unlock(); > out: > + if (READ_ONCE(nohz.needs_update)) > + flags |= NOHZ_NEXT_KICK; > + The confusion was about how we'd ever get there and not have STATS set, but i guess having it all nicely gated does make it saner. Thanks!