From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (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 1E321D52F; Sun, 16 Jun 2024 14:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718547396; cv=none; b=jkol4h7eCXswzz/l1128aHglN45qsUzAGMrRZnDoqsKww9I5SAgzlyFjw7I8XDv3uFUOe4gbk7q0nOMkQs/UKX9rQaWTlynx/izzQsiEsmcTOuSQWpsLfccxEtazDOa8VfpCWuOroucOJOuv306Pmbt0QukInkbtjGxkz0mYtJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718547396; c=relaxed/simple; bh=7bdxquZWzFdlKtstaLLemdgdpCp+iDsft99AmCaM1WI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XWeXqEyjvy9BxSYp6R65q2oOpcjosrhLPzr057FXXBTJx+LC6hyEID6EYRNIRWIHLgcpzC6pL5LAiuCpXi+2nh6/TH45FDJUgS54ikD6xs3i9+fAydyvv0T6GyBDkKYooCRetJqKkqVG0Qkl1mS1UEgVjGL4NLc89LuUGmHbeMs= 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=mTLuhBXj; arc=none smtp.client-ip=209.85.160.54 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="mTLuhBXj" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-24c0dbd2866so1885042fac.0; Sun, 16 Jun 2024 07:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718547394; x=1719152194; 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=ChmSjGncEeieZ8eu54I6JXi04yAV6jjSlQKYshr68pw=; b=mTLuhBXjaaMYdF8pINczm1qqipTE+GK6IdSLSFzVRjwgFTdoWgZsqilYKsBKJ9xIiR Zni2uxjLxbQiydZZoXje02vCl8jq81ZKObT4aDRSTxYZKdTgvEVg0hs29Styffn0ckJo SSLEEhMnUR0mVMf5pAed9EtX0I2AdhARIRvtydkC1rhh6cq4akY4+5Kgk6jScoCVF3gs V1W4Yqso9ThkfufhSBgqctO4RcqbZOJDbHubojmKdwOkWCrlpQqnJ8Pf15tvDII6vW/8 ngwlOSSJn63f6lJoR/OJ6/xaiZUnCpRWYvFQHBq5/nGdMVRYsZKjoQ2GJO4r5424nKDT dDtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718547394; x=1719152194; 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=ChmSjGncEeieZ8eu54I6JXi04yAV6jjSlQKYshr68pw=; b=ZgmmfyY47hslVc3QkOl2MBSDQ9GbPTGCw0fDRqtaOyMAVk6Gwi+CGy2EzO9PKLVv4i J96pzb7ukpg3tan3r3J60O/JbuLgjuXtNQX3qFI5XWHqv/g8QSa1JQztKXjoqT+hvLuW G/Kjf1jdq644Un6n3/rrF5qHDr2dtpT2oyH8WHGo7pZWT6c0cyt6tuIA2WkPX16zyqU3 S+CpGhM0cyHdDklryc6TZuPtztaZiG1Am/ObqzTIlVhKVSml2y0/JGPW4swyQIbZXmsg jZRu/ne7W93Rdx5Dck4IjlEdm/2nkeoYy8Pf/zLifDxHirslggs0aBV2pPJLhsLDeNzi 9E4Q== X-Forwarded-Encrypted: i=1; AJvYcCXN6yogkUFl+e1TX2EH07yFKbYTP1VxLeQevf/pQleDlcjjWe8Ka12jByWa0c1utvc1Ruop5cBrxc7+wFHhDvBDeZsh+UdvFtLPG7VM8BF4YtL0/+74aJXxfpXYeVj69VdhtlS4+M1Z4I54wD1FZMbfQw/8SIOhJtvSmI+xXwJepu8ykBnHfz28YFKTUlUYuHMspMPHZhHQh40ZK848g2dLGEAylf9NeQ== X-Gm-Message-State: AOJu0YwTdAvmWz6LgecHWXU0iMXQa9UZ8te4HWvGHKr/Duv4YXHzHGOM ToPkf2+IAa8iDNNNT0DUAfZ4WU6Iv23hFxHQ1GvDlrMoWmXSMnqY X-Google-Smtp-Source: AGHT+IEJURaA8R00zuQB4kZ2NpS8xoyLpNJer3p9uoW3RueWraMEm/js9QdlmSnSEq9SjQvZLHSrYw== X-Received: by 2002:a05:6871:3408:b0:254:9501:db80 with SMTP id 586e51a60fabf-2584293f32bmr8961724fac.14.1718547394027; Sun, 16 Jun 2024 07:16:34 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79a4e1abc56sm73235085a.65.2024.06.16.07.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 07:16:33 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfauth.nyi.internal (Postfix) with ESMTP id A7EF7120006A; Sun, 16 Jun 2024 10:16:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 16 Jun 2024 10:16:32 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvfedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 Jun 2024 10:16:31 -0400 (EDT) Date: Sun, 16 Jun 2024 07:16:30 -0700 From: Boqun Feng To: Kent Overstreet Cc: Benno Lossin , Miguel Ojeda , Gary Guo , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , kent.overstreet@gmail.com, Greg Kroah-Hartman , elver@google.com, Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , torvalds@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, Trevor Gross , dakr@redhat.com Subject: Re: [RFC 2/2] rust: sync: Add atomic support Message-ID: References: <5lwylk6fhlvqfgxmt7xdoxdrhtvmplo5kazpdbt3kxpnlltxit@v5xbpiv3dnqq> Precedence: bulk X-Mailing-List: linux-fsdevel@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: <5lwylk6fhlvqfgxmt7xdoxdrhtvmplo5kazpdbt3kxpnlltxit@v5xbpiv3dnqq> On Sun, Jun 16, 2024 at 05:51:07AM -0400, Kent Overstreet wrote: > On Sat, Jun 15, 2024 at 03:12:33PM -0700, Boqun Feng wrote: > > What's the issue of having AtomicI32 and AtomicI64 first then? We don't > > need to do 1 or 2 until the real users show up. > > > > And I'd like also to point out that there are a few more trait bound > > designs needed for Atomic, for example, Atomic and Atomic > > have different sets of API (no inc_unless_negative() for u32). > > > > Don't make me wrong, I have no doubt we can handle this in the type > > system, but given the design work need, won't it make sense that we take > > baby steps on this? We can first introduce AtomicI32 and AtomicI64 which > > already have real users, and then if there are some values of generic > > atomics, we introduce them and have proper discussion on design. > > > > To me, it's perfectly fine that Atomic{I32,I64} co-exist with Atomic. > > What's the downside? A bit specific example would help me understand > > the real concern here. > > Err, what? > > Of course we want generic atomics, and we need that for properly > supporting cmpxchg. > Nope. Note this series only introduces the atomic types (atomic_ C APIs), but cmpxchg C APIs (no atomic_ prefix) are probably presented via a different API, where we need to make it easier to interact with normal types, and we may use generic there. > Bogun, you've got all the rust guys pushing for doing this with > generics, I'm not sure why you're being stubborn here? Hmm? Have you seen the email I replied to John, a broader Rust community seems doesn't appreciate the idea of generic atomics. Regards, Boqun