Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5495104rwb; Wed, 7 Sep 2022 03:55:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR6W2CCLP+9Fwk+atiIQkSI54xTQwGlcZdI+U6bwQgEDLaOrkkDEFqstsl4t/FO51cNv6bUN X-Received: by 2002:a05:6a00:a04:b0:534:d8a6:40ce with SMTP id p4-20020a056a000a0400b00534d8a640cemr3193754pfh.15.1662548109984; Wed, 07 Sep 2022 03:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662548109; cv=none; d=google.com; s=arc-20160816; b=Bar+UtFa+8eJSSWGoMYeMr6pDPB9uuuNOnIAn+5hDH4LyDq+rQgUFIO8svecrzqTij 9cFApHJm0l59mQGYPaOeShZwuqWSxnkb0w1pX65K2ejGh1xZcq6CCuCPjk1ZYhRfCgfE 7sKx3GpmJOBwKTHMN+6gbLZW0jHLggCRq7bvCytL+srdXg42LFURzBVh02+6/4o1DIA3 IapT8Bagyyqt2NwFBIVka6/pZU/S95DYTsHJasUZ3HsST4RHBxQroubLqRg0fXxEgN5C cPjpw9durHBVb2Z3ericPrZol01ca4Hnxdrxf4tpbl2CeDhFjW2EnaMLTAHEEMLCo+1/ +W+g== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mzwmk1oOv4JdQTKjENBNoZRq8+V5EmG3daewyk6GNtU=; b=Bqh1dI35xM2CQt7xrSh7/fo7Mj3EDpUvsnZF8l/lf/qN4JhRLXEs6s3CUpcUCfCKhX NgumEN4nPiVZolqNvw1hmEUEQwzTJej9wN0TFq1Smy9vynBrHyqMhsr301UFfVUkKILH E2wvesu5/Fo8Uv3EuiwHUd6FPHJPfU/zuAPzus6jQuloKr7XDu+4JAMW0Hy4+8JzHTZr wbV+01goXeQeCCGNzVn6+hwXTC14QAJiDzu+2EJCokW74+ojbTxvdpYKbSxmQphbz/ww N2l+lZNhArFcoxtaEwNjXZmHOdNrJYf5UqpuuQ+b1CxtiVr5o1jLuJAAKIhIW6wFrpL3 8h5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mg4WHLIJ; 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 f10-20020a170902860a00b00174cd29888bsi14886834plo.235.2022.09.07.03.54.58; Wed, 07 Sep 2022 03:55:09 -0700 (PDT) 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=Mg4WHLIJ; 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 S229836AbiIGKD6 (ORCPT + 99 others); Wed, 7 Sep 2022 06:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbiIGKD4 (ORCPT ); Wed, 7 Sep 2022 06:03:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65C6CA1A5; Wed, 7 Sep 2022 03:03:55 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 25645B81BEB; Wed, 7 Sep 2022 10:03:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA14C433D6; Wed, 7 Sep 2022 10:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662545032; bh=cP3n6lYGdS8Im7b3OzknOQvKOK+r1YmiyNwd/uRfFWU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mg4WHLIJt8mwvUi4wIAi6wHkD84YEmod4vIzAwCIB9C/Mi65oE+oz1z6Qn2nKK01n SmGz0fwwk93PcIkyNvfGu6gd8Qo/5J4s7OFlbfxuiKzpWFqZsHXUc9+tf8khs43O2x Vnrys4fz/3GHMzJQjkwj653WlqHPNo3tg+VUmm2lT9qFxi1NTxviMulDxiYWWATEWS jQhCEX7M3JrUiiYtIWh/XTicYylg0+LeH5zySTUDt53feTCOYULDQyWffwwPJcG8b6 41prHBLCbxLJtmsuP8fm/dPxnqQ7ueS5+Rbmj3hwzeW6MtuMgraE08cckWpM4LAuym GISzjigV7dxYQ== Date: Wed, 7 Sep 2022 12:03:49 +0200 From: Frederic Weisbecker To: Joel Fernandes Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, rushikesh.s.kadam@intel.com, urezki@gmail.com, neeraj.iitr10@gmail.com, paulmck@kernel.org, rostedt@goodmis.org, vineeth@bitbyteword.org, boqun.feng@gmail.com Subject: Re: [PATCH v5 06/18] rcu: Introduce call_rcu_lazy() API implementation Message-ID: <20220907100349.GB194889@lothringen> References: <20220901221720.1105021-1-joel@joelfernandes.org> <20220901221720.1105021-7-joel@joelfernandes.org> <20220902152132.GA115525@lothringen> <20220906151757.GA183806@lothringen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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,T_SCC_BODY_TEXT_LINE 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 Tue, Sep 06, 2022 at 12:15:19PM -0400, Joel Fernandes wrote: > >> + > >> + // We had CBs in the bypass list before. There is nothing else to do if: > >> + // There were only non-lazy CBs before, in this case, the bypass timer > > > > Kind of misleading. I would replace "There were only non-lazy CBs before" with > > "There was at least one non-lazy CBs before". > > I really mean "There were only non-lazy CBs ever queued in the bypass list > before". That's the bypass_is_lazy variable. So I did not fully understand your > suggested comment change. I may well be missing something but to me it seems that: bypass_is_lazy = all bypass callbacks are lazy !bypass_is_lazy = there is at least one non-lazy bypass callback And indeed as long as there is at least one non-lazy callback, we don't want to rely on the LAZY timer. Am I overlooking something? > > >> + // or GP-thread will handle the CBs including any new lazy ones. > >> + // Or, the new CB is lazy and the old bypass-CBs were also lazy. In this > >> + // case the old lazy timer would have been setup. When that expires, > >> + // the new lazy one will be handled. > >> + if (ncbs && (!bypass_is_lazy || lazy)) { > >> local_irq_restore(flags); > >> } else { > >> // No-CBs GP kthread might be indefinitely asleep, if so, wake.