Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3369688rwb; Fri, 20 Jan 2023 15:16:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXtwn+JYR3zgtkokdo6fMhWzQtL5P/5msp0H34aKlplOhBAOoYIuHMzHJXjCD+KXoTJOim8k X-Received: by 2002:a17:90b:1c0e:b0:22b:b5c7:4fc with SMTP id oc14-20020a17090b1c0e00b0022bb5c704fcmr3089135pjb.46.1674256600597; Fri, 20 Jan 2023 15:16:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674256600; cv=none; d=google.com; s=arc-20160816; b=Elx6iLh/poSvirQMYcd6ZqSjsCldF5tg2FvOSBfYd/vr6pDLcaxIbzs+BRczJmGkOi AoYBJjahqWyxkO6u/AVcHtWsdOzS8SGM20QFLmEN0fAMRrmhofb4V292f4EZoor7n5Y4 iBgQViBdLV3Z+7lIcH50Ml5Qj9pW+BST31WekW2GlYNYLQjDOo/blZdK6lM8occkqRHX +k8DAZT7OML47Iy3+BEuInDJyneLX1wf3kP57jaka6Yufjyv+6+LEbK1m6m7pBtFfoth TkzvH+V2P5rheYzk4J7oVCw+GDT8Vq0tAOfmwMk+CPZdIUwhQPP2lx28MFt/qzC9gOXi pF+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9DeF/+jLMfOiw3yMVq6+Q1/YQPUdYtZPCBa8/YA28b8=; b=zEd4TJLIvBvcYkjRUa8KM7u9wEP9vR/zy/DriL18KF+jWE9SyzOHfqZSOj2wYMzWAU vZBqlQ0GC21cO7Dlwr99lqEMDjk4aX2QyPpJbbPtv1PX6M0/h6UTBH2n3nc5EKYkVgnV RAJn8CZSi+X9c1EqogtxzFYJsxGgtZZhC2QHouLAo1eiLvj9a2FEZYVKBEYC8EDTF8WP ZPFb3SwVgdsjC1ooDEF0js0uDQ6UDhH41aqgTX9pxkBL2KS7S59CmRpzQ9M1jYOrbga3 0bfMVxX29w44eEEbjIVmPHLxo+Qx29owqTrD1PvYKltDve6c8VDSPeVTqEtab0ednP32 0uBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gyz6TzB3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd9-20020a656e09000000b0047ff30aead2si45870879pgb.841.2023.01.20.15.16.34; Fri, 20 Jan 2023 15:16:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gyz6TzB3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjATXE7 (ORCPT + 52 others); Fri, 20 Jan 2023 18:04:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjATXE6 (ORCPT ); Fri, 20 Jan 2023 18:04:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DD45E509; Fri, 20 Jan 2023 15:04:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A4C6620DB; Fri, 20 Jan 2023 23:04:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 268A6C433D2; Fri, 20 Jan 2023 23:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674255895; bh=LMsw88cgBpVjJxCIhi0DRVqJ1kShBhfQt3V1Vb3MHh8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gyz6TzB30132BD9VGssYLbtPt5kemf/ipUDNgihtydIFj/1FnEJXALQJ88a0XyrSk dJmRWzDvUCVW1p3+OpQkIa0repD0fkfF6hmT/KMuCsGaeC/Dci//ZzdwOwH5piUZwg CK/mSpidoF6EVlvkUzdJZCem7apBbXqpqFEjD8Agkl+p0BpB8RoKTtoiLVfCO5IOCz fk3rIf/f0+zV17AUl+2oi+DZiW6zZsnkC/SYf2amAURCENspdLNOjj2hKSRLni9rin l95fmgFGp6J4RAt7tS1AhCj23mPLdomYGuKAPtdE6uIuqmBhxGYIxtm8dUv497aBDV YEcjkN/BwIh9Q== Date: Sat, 21 Jan 2023 00:04:51 +0100 From: Frederic Weisbecker To: Joel Fernandes Cc: "Zhang, Qiang1" , "Paul E. McKenney" , quic_neeraju@quicinc.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 08:27:03AM -0500, Joel Fernandes wrote: > > Sure, I know what the code currently does, I am asking why and it feels wrong. > > I suggest you slightly change your approach to not assuming the code should be bonafide correct and then fixing it (which is ok once in a while), and asking higher level questions to why things are the way they are in the first place (that is just my suggestion and I am not in a place to provide advice, far from it, but I am just telling you my approach — I care more about the code than increasing my patch count :P). > > If you are in an intermediate state, part way to a !nocb state — you may have > missed a nocb-related accel and wake, correct? Why does that matter? Once we > transition to a !nocb state, we do not do a post-qs-report accel+wake anyway > as we clearly know from the discussion. I'm confused. We are doing that acceleration on qs report for !nocb CPU, right? > So why do we need to do it if we > missed it for the intermediate stage? So, I am not fully sure yet what that > needac is doing and why it is needed. To summarize: * If the CPU is NOCB, all the callbacks advance and acceleration is performed by the rcuo/rcuog kthreads. * If the CPU is not NOCB, all the callbacks acceleration is performed by the CPU, such as in the case of rcu_report_qs_rdp(). * If the CPU is transitionning from NOCB to !NOCB or from !NOCB to NOCB, the kthreads may not be available to do the advance/acceleration, so we must do it locally. That's the needacc path. What am I missing? Thanks.