Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2048348rbb; Tue, 27 Feb 2024 09:04:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX+PEmI23pOutrd4tOIE3RY6Xs55wGCAH+HN9X6+TgrpQfJlkkrTRtErYb3ukcvXm1hAgMmJXSSBclGVkjUDuOxJonloAfCFurRpjyJrA== X-Google-Smtp-Source: AGHT+IGcTX504BWVLg4b3RCS+YNdL6G3FdmGsNxyZQAjqHCsWnyLbI4zHwVyiLEnD2lRJp5ChBfP X-Received: by 2002:a05:6402:358b:b0:565:9a35:9e62 with SMTP id y11-20020a056402358b00b005659a359e62mr8989457edc.7.1709053448689; Tue, 27 Feb 2024 09:04:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709053448; cv=pass; d=google.com; s=arc-20160816; b=bzEeQ2oDYepgfCjuSD8XBcCR3o6x78VqCNgcOtWBoF5dessSkyfOFIG8aA9mul2/BD Kl/bMvm8YeWbNrdwZjlJRLE8fnfOlKFXRQRD4brb9WyN6hDvwSJEptyiNOoh6HAVxPjM oilHnYRw3RHCKUnG3WKgSb53OK25iFqIa0kC3EMzs7BOp9EsxxKS/XgBzl90fI7VhZLT P8fKhb4jIuoaQ+SLq9QNoNQQmIcxCZ4PNgJvDIIJtIUO6wlzAkE6hXzU1H38E3VgmVIw ERaGEUZCQbYo7OdlQ6Xeaj43EXPnnO3yI4FTSBpY6U2ygWDOS5xG2afs8PlRYfy1ZB1p 8I5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uB+N0VVhejtub6kw7F552WkjWaxtiHUjcSNFDZktHuU=; fh=pLqVG82dKEKtwR79WearxyXqSZsjaM8zMdYHPaxw/bE=; b=i1JGbNKcJST1uaOjdNbXA5W9PZ4z2tgqwjzNs5m4XfElUpPHX0kuDh4HZTxmAkW37A G+eMeH/ShlW5SGYRxQ4Qgej3AL4xE0gCajSqJYGJVJ7Zk3fmb5xx/oxbaGozahy0tgm3 8z85Vvm9yO1BCCRG+Tx4QN1+mg+dKfN4M/80qnF44wm2G84lfKrMtmK9QKpFuXLeM9gj JO03ivWQNjnJzmTlLc/Mm52WxVvRMR0B3omOmWmvo7HfQ2CxOizc5J0zDKuYuRnKa9Fy LfLQzjCInysn9T2G4S5VR4GGeim13TJg6cFfwJp8DUoDF1SbYliYcjYLTiJNHCTDmH65 aweQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JAGGJVUS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-83670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id de26-20020a056402309a00b00565abe90eeasi825896edb.26.2024.02.27.09.04.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:04:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JAGGJVUS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-83670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E02261F29096 for ; Tue, 27 Feb 2024 17:03:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A19D2CCD5; Tue, 27 Feb 2024 17:03:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JAGGJVUS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC95A38DD5; Tue, 27 Feb 2024 17:03:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053418; cv=none; b=qE8Q2blgg+XoPzOEuo06ODVyb8XLwO0exSISr9r3pbkwSQHDbmhiwFTLXbGNQ+1JpKwKAikC35GShg2ITCN41+I/l6L+YmU6EQiUEW3byepie2I28w+HkCM6TyStXICgukrjFD8fwpMdgivbNwRQwXpOq29HmGLpd8OmviAhM5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053418; c=relaxed/simple; bh=1/bBE1XLy4K5uJe2V1Vu4Qkqw5RQ+NsxPuHoElXjpTw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jyy+I8EvEBsQ6PPLE/BRSzR/smbepnpIjsULQm8crViBVPfexX/+f8k3qbYCbBzpBthZxmwY8Zqwi9DF4P4XRT7EPwwhClbtmGdr8rELOaJWyL/9kcuRXlBzh6DrWCWBCATUpjAJbKdWXieVdsozRYFw9zJFeP0Lp4IrUup6Fso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JAGGJVUS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE590C433C7; Tue, 27 Feb 2024 17:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709053418; bh=1/bBE1XLy4K5uJe2V1Vu4Qkqw5RQ+NsxPuHoElXjpTw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JAGGJVUSrTwX/KkHBqEDAPZV/3Ri4Z+yjiosNvfEJVX0TreKnaHbhm0SlpB2RtTbC Dx2gRfMjxjm6SCfHL9uYwGJlY8wy7i+dDVJBQhSIHkz857yk77mekpqQgN97tyJK0P eLs/Mts1gRkp/heNwLnrws9gZBEKSTyyPN2u9+VB+Pyv1vAMY3Nmxdsz9vrW2FVcIr A+2VrExRZLv2rauRkncLJDv0/Ehen93zP/2j8UYypauI1e/YRs5xaIJkaL6HhaSSFC bXI66Eug83/L9pxPnaP0ahp+dDRHLATUbv6zY2A9NuDjM5OeWsA8BIJDyfNXjonhbp TFoZZhJyPBzPQ== Date: Tue, 27 Feb 2024 18:03:35 +0100 From: Frederic Weisbecker To: "Uladzislau Rezki (Sony)" Cc: "Paul E . McKenney" , RCU , Neeraj upadhyay , Boqun Feng , Hillf Danton , Joel Fernandes , LKML , Oleksiy Avramchenko Subject: Re: [PATCH v5 2/4] rcu: Reduce synchronize_rcu() latency Message-ID: References: <20240220183115.74124-1-urezki@gmail.com> <20240220183115.74124-3-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240220183115.74124-3-urezki@gmail.com> Le Tue, Feb 20, 2024 at 07:31:13PM +0100, Uladzislau Rezki (Sony) a ?crit : > +/* > + * Helper function for rcu_gp_cleanup(). > + */ > +static void rcu_sr_normal_gp_cleanup(void) > +{ > + struct llist_node *wait_tail; > + > + wait_tail = rcu_state.srs_wait_tail; > + if (wait_tail == NULL) > + return; > + > + rcu_state.srs_wait_tail = NULL; > + ASSERT_EXCLUSIVE_WRITER(rcu_state.srs_wait_tail); > + > + // concurrent sr_normal_gp_cleanup work might observe this update. > + smp_store_release(&rcu_state.srs_done_tail, wait_tail); > + ASSERT_EXCLUSIVE_WRITER(rcu_state.srs_done_tail); > + > + if (wait_tail) > + queue_work(system_highpri_wq, &rcu_state.srs_cleanup_work); You can queue unconditionally here, wait_tail is non-NULL at this point. Thanks.