From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 8881432FA18 for ; Sun, 18 Jan 2026 15:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768748711; cv=none; b=jDbCRXvPaUvLIcFjpIonBF0Lcf5HeCdsxpgEva8E9lUjHAp/vCBqi/QswiN7J0ylBRIXjHa0kvt0VnSK1NCuSIPah2Z3MD6vSnLbouztTFyC0Vfgx+qF69bsILHcZ9jPlhw8YyIloorN/deH92wZhMYUFUU1SPoO6N77LTKOmVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768748711; c=relaxed/simple; bh=5vRsRWeMNtoPVYsJZKkrfh9mzvgru9Cb2lGawFduPS4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A0qSuQAbbdGUFbxIhtMzBqHgtsmsy3xslT9ioKOuCF0hd7xzHpkKKrAv3b+sFG9BIRWlhPYqYEnkUGB/jSLOEO3DR1j5CoE4rfVJQWDgtOtfiFrLaBpEYd7/zLqtCWXaux1CINdbkgfeMy6SljzFs3niqQHQCTSjkQnLxrXmz0o= 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=Z98NeYzm; arc=none smtp.client-ip=209.85.222.179 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="Z98NeYzm" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-8c6a508a595so292574485a.2 for ; Sun, 18 Jan 2026 07:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768748709; x=1769353509; darn=vger.kernel.org; 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=21uLaqJ17tNxzyJX/CswTc0v9JKdWpeTLh7D9bEVPhE=; b=Z98NeYzmpw+qePaVCufd1WPP3bJIB+wGRdTbU7jPuzCTubMba+PWkNktg2028HGJ0D q/g3A9SrEPZGcmlkNQ+l+Sadj8coEP956cjiz1z9VNg1vMpGSaVb2dfevmol7IqILot5 g3HDRp6za2qlhHqZ7jNhxhD9bhutWV+64rclYFh/vsDMaRMlZnp1GGwXjhqFi+X5mHyb 3+pZwpn8Stp/LJHAJy3WIX4YPGkHlR073Y9BtSXfJLJp8YZqaFChsJrfeT6m7v7/zGnx 18AqZISBtF+NLkFsYwDZndmyvd7N+3JSxdXQumhpWjfJIseamxfgjT12R/UbWAc5fKsw y/VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768748709; x=1769353509; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=21uLaqJ17tNxzyJX/CswTc0v9JKdWpeTLh7D9bEVPhE=; b=EvWfG+IDj6Nh9Rmj7GiV+5BU5+b3JEXSpWQVMvVN4Cl/ia6I3lp4e0lY9pqaQRxaJ6 PnFObgohg9kGsfCypzNs1UaehbTDGrjR6R1WO76I7eeDuRvX1/3oJyCuIOcnLxu8rTem VGh17R9FeHa5iyDIDL8y6gio5CdFamxwSH0LmNUSTtuz62I7aN5SfBxuuLkEXyH4uyOM PobfLHTtABF0AV412zkIfq6fxvAI/JzLOlbLYc+F9TNQiQQD3+5JzcjGiISVCeDTm1DB iicOFSN2fg7rcWhXEI88k9pHoPrUIZAMwBcFybF5EdUUfF/cVJ6e2rpjo2gc+5JVfVw5 ZPEw== X-Forwarded-Encrypted: i=1; AJvYcCUr1fDA9OQy0TkvnMl3Wf74wb4ZEFWk+KWzjU1fTcIOSA4ZOH3S7uL9mj0CKVWJkhfTIGDSnU4JqZ1xRxU=@vger.kernel.org X-Gm-Message-State: AOJu0Yyxl+CEVRyHRPZ5/zgjv8Rb+z8je2VBJ8ZSxZryB45gR077wn7h 9/LGjtpGgH45VerfnLzS56VlRyXC8wWV8Pm5KxnpNYuujOPPWxAarRzK X-Gm-Gg: AY/fxX7L7P7dqWtkIjD0rnNfiyDvEnoeMGKroVYJ2zKCdrsKq548G5tnnGX5vHNYA/5 Qwt9usd6LDggz6WIb5L9CKGOtQMjqDg+On9NE+Uj8q6Db1dl3Sw5QEI320A0ftRHYBCkD+EBqmN fQy5PwNlWaa2iMhsYa4IxyMNnpw0HPNzjnJ8I6P+JHQjytNGeX58F0Rm2JkbgTvDzjbnDCDLB0S rDr2DauDGiD21F1JmATBgCGWHq8oZ+dVKH1dIxE/yHZXX3f2CCF16Yg8aHVMpxFnwSTFo3MIgX8 zThMLLf0Wlq65/Id8jT8gd1pF5F5VxBkWJF7gob/NxMwhcR3LDYHtL60vRUOVzKNv2jIIm7jmVj uBQR8Ly4izfJ2iIqEP2JqeRu0RymGp29pj5hxttSKQIqAWBbnLix80KryQJIf/CnYzKqQ399Dfi AOPTkAFQ3xswjV3E4kasgh6ARuIwQeWh1PydU7OBMPZd3TetIoLFTgB35FUbFRUeRU44OOM+1++ n4YenJO/Sbawws= X-Received: by 2002:a05:620a:c4b:b0:8c6:a608:5abc with SMTP id af79cd13be357-8c6a670532dmr1195312785a.28.1768748709345; Sun, 18 Jan 2026 07:05:09 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8942e603a8bsm64025876d6.17.2026.01.18.07.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 07:05:08 -0800 (PST) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfauth.phl.internal (Postfix) with ESMTP id 28814F4006A; Sun, 18 Jan 2026 10:05:08 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 18 Jan 2026 10:05:08 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddufeehtddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueevieduffei vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvgdpnhgspghrtghpthhtohepvdejpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopeguihhrkhdrsggvhhhmvgesghhmrghilhdrtghomhdprhgtphhtthhopehruh hsthdqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthho pehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtth hopehrtghusehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepohhjvggurges khgvrhhnvghlrdhorhhgpdhrtghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpd hrtghpthhtohepsghjohhrnhefpghghhesphhrohhtohhnmhgrihhlrdgtohhmpdhrtghp thhtoheplhhoshhsihhnsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegrrdhhihhnug gsohhrgheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Jan 2026 10:05:07 -0500 (EST) Date: Sun, 18 Jan 2026 23:05:05 +0800 From: Boqun Feng To: Dirk Behme Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, Miguel Ojeda , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Will Deacon , Peter Zijlstra , Mark Rutland , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , FUJITA Tomonori Subject: Re: [PATCH 4/5] rust: sync: atomic: Add Atomic<*mut T> support Message-ID: References: <20260117122243.24404-1-boqun.feng@gmail.com> <20260117122243.24404-5-boqun.feng@gmail.com> <67e5482b-93ed-4b5f-8375-f7e68c50a436@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=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Jan 18, 2026 at 10:57:37PM +0800, Boqun Feng wrote: > On Sun, Jan 18, 2026 at 09:38:36AM +0100, Dirk Behme wrote: > [...] > > > > > > +// The current helpers of load/store uses `{WRITE,READ}_ONCE()` hence the atomicity is only > > > > uses -> use ? > > > > Will fix, thank you! > > > > +// guaranteed against read-modify-write operations if the architecture supports native atomic RmW. > > > +#[cfg(CONFIG_ARCH_SUPPORTS_ATOMIC_RMW)] > > > +impl AtomicImpl for *const c_void { > > > + type Delta = isize; > > > +} > > > > Are all users of this guarded with CONFIG_ARCH_SUPPORTS_ATOMIC_RMW as > > well? Or do we want (need?) to cover the > > No, the users don't need to guard with CONFIG_ARCH_SUPPORTS_ATOMIC_RMW, > the purpose of this #[cfg] is to avoid surprise that when > CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=n arch supports Rust, when that happens, > we need to add the support to the helpers of i8/i16/ptr. > Hmm... I guess at this moment, I probably should do #[cfg(not(CONFIG_ARCH_SUPPORTS_ATOMIC_RMW))] static_assert!(false, "Support of architectures that don't have native atomic needs to implement helpers in atomic_ext.c"); I can add a patch in the next version if it looks good to everyone. Regards, Boqun > > non-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW cases where someone tries to use > > Note that these arches are very rare, so we might not have any problem > for a while. > > Regards, > Boqun > > > this as well? > > > > Best regards > > > > Dirk > > > > > >