From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E1F71D47AD for ; Mon, 7 Oct 2024 13:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728308934; cv=none; b=OypLZ+kehqjze8qzfPOPgVsTwstolmjAP6AQuzuOPRfZV30xzAtC3Zuspxa0lYbEUOltqZ+cs5mCH0VVbOSFwF4kgSeAzb7dKmOkojIK18FUCB5Yxs9w/g7rHh1inbX7Jf+NttRpUytB6Ebz74qcI+ejKx2KS/FehzCuRN3Yp0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728308934; c=relaxed/simple; bh=HqvDmsEwt3nBhi9RmWBkqnjY7cwdcYMS/zw0M0PgAxs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yvlx9kk7/Z0nesfrbpKqhjIgYuD6deZzSR3+kuvuUhPlA0qy1cNuTfOPezbo94Ps2ICMA+A9alEiUhbWwuUlqOX0AOdU9QbaG4ah7owFIuPaTcG1w2w+uA3dnmQavPtyHJ9x3ZdXMh5Qsf/oR2IZ3diEoTar9yFeJ9XaHjPBc28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CLwaJ8HO; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CLwaJ8HO" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4585e250f9dso32719831cf.1 for ; Mon, 07 Oct 2024 06:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728308931; x=1728913731; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=S5zlc/854P3mwwD/0En7ZUUQ9UADgcI2OWzxIEzuKD0=; b=CLwaJ8HOHFDNasE/3GNBt7y2MTxAEbuynXm3bHvggFIMvIZfrrbeeJTH0rF4qRhLxN C2oSEXpDg/gN93XgtICRu3sVxodjrAYV+UNPDsD57q2ShofB+1IM4jUnGo6QFS/l1MCu oM8Ln1E6AAIYRXOb8pGc0l4BWmb+aw1bcMb5231FWT2NpXu8hvJVSPrRPplX1kj4lf6x CGbv+rMHArGKQUPlYl571ths4KQhEGHD1KrYFtMBclhpgNoOzAeSOEs1psrie81f8ySG qxM7ttnU51US+gZrPZCf0xU3Rk7hiSN8i/ibOvQbBmYGKzAtDTn4R8m4Lmf7vSfIZU3H Gvhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728308931; x=1728913731; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S5zlc/854P3mwwD/0En7ZUUQ9UADgcI2OWzxIEzuKD0=; b=uN1W8FvEgngOOAe0FLLJwY+szzuy0HOugKcMRMpi2X6lxeLf92trxQNwYOE9R7J7xe t41cppk50NVTYpZ6FfDimwmRhgUUr5Un784U3cbqOfm9tIBvltJVdLRPOULkbEwaESXx q4GYDp4bHJzVBMetgVtGH4Vclq4DuUedYbe1tu2xkcYe1PrpdjJB1OvBUPR54YDax+YT H0+OZ2c7z6BFIWcfd2q/USYws69mB6XdWf5oplp2rbYp0KBUxQDNbp9lgHr5jzYApS1+ y/+Ak9wOYqrXi+Xv6U26r0kbH6GwJTN9qI0ozpiCeFge4XIXasUQ7pbt2nhUKeaKzKN2 8n4Q== X-Forwarded-Encrypted: i=1; AJvYcCUfHlGzr3WWk5mN5W4QkuiJB6xjNdnNxqr0EqRcjrHxZWQLcV37XSmMZNnt78rKk+2ZH7zW@lists.linux.dev X-Gm-Message-State: AOJu0Yxa0ghV/f2aEJk/2nu/SC/LBqF51x2L+G/Ol8t1PqJ2ZSPohP87 C+jlK9gwYltdxm8WyCFIuH+hhxTh9/Oq6CPtbZX4kXV8II80nTPv X-Google-Smtp-Source: AGHT+IF6VdfvkU2hzrMRUahm5soqFN17kLE0fZGLWYpM4oiAxmIcoVTIgYNseUzL9676we7a+dYQNw== X-Received: by 2002:a05:622a:1301:b0:456:4655:34e6 with SMTP id d75a77b69052e-45d9ba4f77bmr168237951cf.23.1728308931437; Mon, 07 Oct 2024 06:48:51 -0700 (PDT) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45da74fabffsm26429431cf.28.2024.10.07.06.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 06:48:51 -0700 (PDT) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfauth.phl.internal (Postfix) with ESMTP id 1B80D120006E; Mon, 7 Oct 2024 09:48:50 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 07 Oct 2024 09:48:50 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvledgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomhepuehoqhhunhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrd gtohhmqeenucggtffrrghtthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleei vedtgeeuhfegueevieduffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmh grihhlrdgtohhmsehfihigmhgvrdhnrghmvgdpnhgspghrtghpthhtohepfeefpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehmrghthhhivghurdguvghsnhhohigvrhhsse gvfhhfihgtihhoshdrtghomhdprhgtphhtthhopehtohhrvhgrlhgusheslhhinhhugidq fhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprghkphhmsehlihhnuhigqdhfoh hunhgurghtihhonhdrohhrghdprhgtphhtthhopehpvghtvghriiesihhnfhhrrgguvggr ugdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnh gvlhdrohhrghdprhgtphhtthhopehnphhighhgihhnsehgmhgrihhlrdgtohhmpdhrtghp thhtohepmhhpvgesvghllhgvrhhmrghnrdhiugdrrghupdhrtghpthhtohepghhrvghgkh hhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepsghighgvrghs hieslhhinhhuthhrohhnihigrdguvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Oct 2024 09:48:49 -0400 (EDT) Date: Mon, 7 Oct 2024 06:47:31 -0700 From: Boqun Feng To: Mathieu Desnoyers Cc: Linus Torvalds , Andrew Morton , Peter Zijlstra , linux-kernel@vger.kernel.org, Nicholas Piggin , Michael Ellerman , Greg Kroah-Hartman , Sebastian Andrzej Siewior , "Paul E. McKenney" , Will Deacon , Alan Stern , John Stultz , Neeraj Upadhyay , Frederic Weisbecker , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Lai Jiangshan , Zqiang , Ingo Molnar , Waiman Long , Mark Rutland , Thomas Gleixner , Vlastimil Babka , maged.michael@gmail.com, Mateusz Guzik , Jonas Oberhauser , rcu@vger.kernel.org, linux-mm@kvack.org, lkmm@lists.linux.dev Subject: Re: [RFC PATCH 3/4] hp: Implement Hazard Pointers Message-ID: References: <20241002010205.1341915-1-mathieu.desnoyers@efficios.com> <20241002010205.1341915-4-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: lkmm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Oct 03, 2024 at 09:30:53AM -0400, Mathieu Desnoyers wrote: [...] > > > + /* > > > + * Use RCU dereference without lockdep checks, because > > > + * lockdep is not aware of HP guarantees. > > > + */ > > > + addr2 = rcu_access_pointer(*addr_p); /* Load A */ > > > > Why rcu_access_pointer() instead of READ_ONCE()? Because you want to > > mark the head of address dependency? > > Yes, the intent here is to mark the address dependency and provide > a publication guarantee similar to RCU pairing rcu_assign_pointer > and rcu_dereference. Do you see any reason why READ_ONCE() would > suffice here ? READ_ONCE() also provides address dependencies. See the "DEPENDENCY RELATIONS: data, addr, and ctrl" section in tools/memory-model/Documentation/explanantion.txt. Regards, Boqun > > Thanks, > > Mathieu >