Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9575948rwl; Wed, 11 Jan 2023 07:24:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsDqY2JuL59wcz7RQOMzt7SsOsAa5xUNNYoE+AhAchLxn7QHWk/DykXg45s/pfFmdqht3oK X-Received: by 2002:a17:90b:1208:b0:227:2081:864 with SMTP id gl8-20020a17090b120800b0022720810864mr9512010pjb.24.1673450641936; Wed, 11 Jan 2023 07:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673450641; cv=none; d=google.com; s=arc-20160816; b=IMJeAb7eIPOmirQA0GU6iHiW7foFEGpaSi0US6tHEO0GIuGf5KUmRc11yJxRhRhe+B HwC2AeIdcK8xdGXGW319x9pCLYA0ikrwuz+NmLdShXIoCj+0Ge85XZQV03viz32mNSkq 4uzR8v28RhJ6cmPHXdHuRFguN12+3JtynwVPNZ+WJ8V1HqA58QFj5t9VrTJkUuw58TpB U1Twzs0yaAO+C1i3PGOy9Io+Tal9CPomNLu1rkSlN6iYjCqeVMtA0/Z/wijUU267SQrU 6uLY8qMNUNH7lObDrmzgOo5ohUDWJ0jLFfHlJqyf/yydtTqO0asQFyb+k1VO65ULZaFk KVaw== 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=LAhRPqD4jK+1utYSMKEiUBF/ohz3JQQ1gtcihJd+HyU=; b=uWksU4C84z6yaPitYa+bmiHMHWLofCJwib1IgxQJhEm3JVrp+6ITNWkoYSe/psTNkW S0LAR8owGoFSXmIKsDY8ET3LQQ7lIHHC21I1tDMU0g6RGqjTdhL5LSCxMvg7uRmczm5/ edDK0AHPu7Qj1f3wbPdb+4JlwenkGC15J/5kEM2jfWpA7Gk79tpRs6nJz/4u2xlWln5x G/UqttpxmU5thUmjzEGOBnAM+qxlzvRsQU0NGl/H5lQlP8Fa4+dFEGV+uGmOEOHUYpx4 IQXt+GJ6AI4O3GSTRM5O0k6AkY6/BDAlzCVS8AQzvbRC7e+2WAAD1XkC05F8I6/nmllg pZag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dzzVw6+q; 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 mm20-20020a17090b359400b001faf26eed66si13284731pjb.150.2023.01.11.07.23.55; Wed, 11 Jan 2023 07:24:01 -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=dzzVw6+q; 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 S234999AbjAKOtI (ORCPT + 51 others); Wed, 11 Jan 2023 09:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234188AbjAKOtC (ORCPT ); Wed, 11 Jan 2023 09:49:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3433411C2C; Wed, 11 Jan 2023 06:48:49 -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 ams.source.kernel.org (Postfix) with ESMTPS id D975FB81C0A; Wed, 11 Jan 2023 14:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06D82C433D2; Wed, 11 Jan 2023 14:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673448526; bh=UEfl0KhVxYyXipkkr67e2P9gmRximnKB5GfIk2W8EsI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dzzVw6+qEMqRcc74jyTIdwny/0zFquyCQRecNUHhIgC4TAhKlfPSzjOmLFOJYxx6Y dby7NZLeH7KuotpImqA062vIQbVEaE6P1yIyonxoVPGOth5lHX/kM5QDVyM2E7wnfC eTkgxEM4YwCFbRFV3KhvPMj0iWWu9LVNGNRldO+qwQO3PLiQUe1FqxSb2iQIRSOAc7 ZMZeLrjCDIWOoYiWB12E+2L9sNb2vSclVnXd7WlVyPlqaMqToS7mNsn/Wsywz4QWLg PqDgwzBWtRnT9GsgY+VCgVBA2ftABOEBnypUjjuJHWdKCjCTSQ7MIFBipCWZXe+K5N OZmbpZ+r6QVgA== Date: Wed, 11 Jan 2023 15:48:43 +0100 From: Frederic Weisbecker To: Zqiang Cc: paulmck@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Fix the start_poll_synchronize_rcu_expedited() be invoked very early Message-ID: References: <20230111131453.1626214-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230111131453.1626214-1-qiang1.zhang@intel.com> 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 Wed, Jan 11, 2023 at 09:14:53PM +0800, Zqiang wrote: > Currently, the start_poll_synchronize_rcu_expedited() can be invoked > very early. before rcu_init(), the rcu_data structure's->mynode is not > initialized, if invoke start_poll_synchronize_rcu_expedited() before > rcu_init(), will access to NULL mynode pointer. > > This commit therefore add exp_seq_poll_rq member to rcu_state structure > to store snap seq number Is it even sane to poll that early in the morning? :-) > > Signed-off-by: Zqiang > --- > kernel/rcu/tree.c | 3 ++- > kernel/rcu/tree.h | 1 + > kernel/rcu/tree_exp.h | 6 ++++-- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 63545d79da51..34b13d6bd8c4 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -92,6 +92,7 @@ static struct rcu_state rcu_state = { > .exp_mutex = __MUTEX_INITIALIZER(rcu_state.exp_mutex), > .exp_wake_mutex = __MUTEX_INITIALIZER(rcu_state.exp_wake_mutex), > .ofl_lock = __ARCH_SPIN_LOCK_UNLOCKED, > + .exp_seq_poll_rq = RCU_GET_STATE_COMPLETED, I don't know if we really want to fix this, but assuming we do, can we rename it to boot_exp_seq_poll_rq? To avoid later confusion. Thanks.