Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2020256rbb; Tue, 27 Feb 2024 08:15:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOg2Ffj24DLmNdsqA/ctJgYhxtTNM3SusIk0nuoT/+CGuDJSkV6qQwkY7dqk545AwduvLSue3JRTgBx8HKIV7uAfbHM7dSNWaIfWsvrg== X-Google-Smtp-Source: AGHT+IHPmUdy9gdQZGQQAFYYUiRiCDqvvEo06hRBqVFphKTmAakDpHdt9V0F52+bAFcYxrkUqi7o X-Received: by 2002:a17:906:f25a:b0:a43:d473:685 with SMTP id gy26-20020a170906f25a00b00a43d4730685mr787737ejb.38.1709050520132; Tue, 27 Feb 2024 08:15:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709050520; cv=pass; d=google.com; s=arc-20160816; b=DnxB1/uyZVvYsUO3FyTGDAm/pAklETVMmmmY1dQUC6+wBt5ynNgLa0l//s/Wft1LHZ GdLFLp9HhOTBzwn1rQmFh7Z+ehcdwZf6ZVjGIJ6E4Y23mNkEYhAhFX3awRwSfmerbUKH 7YulFKPUdK0cpcYeaDEpcIQ1yawP0G0+6SHj6M3mEyg0GE0jnb0TkpF8zFBiMAwT2wJZ Oy2hG+/abPUA9yIhqMV6xZPJF3rov/LugrjMDrBcK2K2hxCe/9I6+2SFEKdP1DucWrbS 9oxjJchZ8PAqdwim2nKhG2dX8k7i1P45x43aC3YTJiRnw5sCyP/7IU9A5iXdKCJuhxUz l73Q== 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=DUmM5YGCifkS4dP+Zuxu6tEoxEskIXEm57XZXoEBBgI=; fh=pLqVG82dKEKtwR79WearxyXqSZsjaM8zMdYHPaxw/bE=; b=Y+p+iYQtGWvb8WY3T4RRoWKclkVdr0TBL8kHJuD6qN+Dia2TjzgV1DgWAzi+2anbVz 3h/gx+M19YyjIC2aaxvgJ7WFdMoadycEBFNpjSffiQhgZSaFkBZ1OZ4ueWNvnUeSRRU2 Y5OeOwoqof5YgQr1B7FRUWelCif9q8q+0hVjzrc77m6q+bE3bCso6Y4Hj2NqOwuDSLfk 9a7VT2gyYCZ45qNpxvo88oiiyjdPUFaYgw87qgHnXO2wnIqMhcN9IrGwULQj7o6pNPUR 7ZAq8PTKSaXx9KoQviug5fqJw0Qhs5wRpJVozLR2Xba93RFiAYBVncTpu5VG5nXsvChV sKLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rwfC0dGK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-83580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83580-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 gb23-20020a170907961700b00a381de492a6si898488ejc.969.2024.02.27.08.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 08:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83580-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=rwfC0dGK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-83580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83580-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 DE7BC1F27B66 for ; Tue, 27 Feb 2024 16:15:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B99A14533F; Tue, 27 Feb 2024 16:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rwfC0dGK" 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 B667B1474A5; Tue, 27 Feb 2024 16:15:10 +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=1709050511; cv=none; b=k9WuRUMomnvEAnOGUnCv50Avi5CIEW293Xi6O/q8e9nGhSSfueQ2LdlWURsj9B7M03Mx2Z1YLtu6v7zx9YKIjA1Xg5mNTYcUnC7Jp1P5QS9rvqOriFlHX7SFLuaMQF54q8yeg/hmiC9XGYM2C1pn/jB5jpdtAXeCSpnPD28Lls0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709050511; c=relaxed/simple; bh=9phnZqI/p+RrHBITJ6u9yXLy+AnyeKje1wey9GQybqw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WxE1RkZgczATe6UReyYnxk/IdQ5GRidIxvCzJpvBLhsmHhuLUuuX6OobKjLwnaDdvHvIARA2fOwq79FcsYEfA7QXWec3i77GlpJzM2vEMlh9K11gx8lBV/jZsyBB+eoT/7klB33O6kyRWtnUWh3vQmDjr3z39UuoR5XvNpC/FY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rwfC0dGK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5093C433F1; Tue, 27 Feb 2024 16:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709050510; bh=9phnZqI/p+RrHBITJ6u9yXLy+AnyeKje1wey9GQybqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rwfC0dGKMFZa+ko3AnfglI5z2LBIy9CQ2e9I4scLMDqMC8E7WupN46PHjyhdIEVkX 5YxVqaC70rV730ag9NhpEADK0MHGkebHuvAfNcWXTaBYlxCA3DIcnMdgkUnYqP7QvT MFCapdc9wdaQBmvspv/60pVTJzc7mnXGn3HlWoqejHgQhKrOkV0wAGL+RYxIh5xcCb +hLjaU3w1hLO+HtJhzTdVNIr0SI4lRga+pdC8ohDnIYJ7B3L1ndCRgBW96iKN/bQhL gNSobVPllEtd+oYEkzIlbdi2Aek3WU0MeMnzDYHSymULveRjfWY2WVl/2biQlJBx5Y 6FqbzDtqk1dZA== Date: Tue, 27 Feb 2024 17:15:07 +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 : > +static struct llist_node *rcu_sr_get_wait_head(void) > +{ > + struct sr_wait_node *sr_wn; > + int i; > + > + for (i = 0; i < SR_NORMAL_GP_WAIT_HEAD_MAX; i++) { > + sr_wn = &(rcu_state.srs_wait_nodes)[i]; > + > + if (!atomic_cmpxchg_acquire(&sr_wn->inuse, 0, 1)) > + return &sr_wn->node; > + } > + > + return NULL; > +} > + > +static void rcu_sr_put_wait_head(struct llist_node *node) > +{ > + struct sr_wait_node *sr_wn = container_of(node, struct sr_wait_node, node); > + atomic_set_release(&sr_wn->inuse, 0); Can we comment this release/acquire pair? IIUC, the point is that we must make sure that the wait_head->next fetch happens before it gets reused and rewritten to something else. Thanks.