From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C1ACC27C79 for ; Sun, 16 Jun 2024 14:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ChmSjGncEeieZ8eu54I6JXi04yAV6jjSlQKYshr68pw=; b=GECZRT/np8sBijPfoKo2d/eNSf bJCmWsQoQoTG/sIL17RF1PsJtI/pqhMRBPCmxp94DMAjsFBYOqS+16RUqMNoUuvjBZaqhZmqLaJEk jKnUpyxeBl8Qrp5STHvAvC4sIE2Y9ADW3bAFM3iaq2Un48v/AV6JrI8c/RBGb2PS8AViF8JsLYf6Q EkuyYGHt10fu3CnLvUDn8jwFEml3X1R+aYJ+6xwuP2EXwtP2jDZkKmvK6p1JhIEbcswII6txKqs6x EXYdVAn3Ixt0RsfPxHDD44VfWdcEHKLHLUVWiyAZ/DknW1aLk7nKFp/re/w0Ml7DqfvcZ0cnzisG6 UjVgBZzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIqgP-00000007gHw-1TJ9; Sun, 16 Jun 2024 14:16:37 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIqgN-00000007gHI-086z for linux-arm-kernel@lists.infradead.org; Sun, 16 Jun 2024 14:16:36 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-250671a1bc7so1722136fac.3 for ; 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=lists.infradead.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=jRjxSWLXZnBgSdqJ4zTDJ+rC3hGCSpCt2+YhqNMEga+G4FzpTruv5mS2mHVripK2ZX vaLbRlw/eia9aiknmP+TC7hs8uvEi576dPBHRjS74PESGI4zj6tFfZgRUc4xOmnav04e ROEeSFX0zXEAa2kXFWEjvAOLRT7hel3mQmBZY1LaIPRE60MrsVMRc/NBIjzrlm41Yc5H PgS0Lmkn1K+p2xTFp+ENoeVaRCzc5GbdW19fx8eSVY0GbMaIoITwwtsQSxZa9xQksslF G0svQZLvV4M2JAMSu9gUwRcKYWAsDtSV9avYZywsvn3DhMBFl2Or67QS0X6teh3D0aGx Ty3w== 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=B9GLmx/hhqlHWYAlvohxpPdX0k6SQQayoSCNaZhPa0TnL1xOSMoZadYe84GTVJ0Dd/ bLtdexAMQ9fHWeARCICbVP2qOpe4GCpRPkbvxLdJLAL0szortAa+DBlvqapy3lixElVb sm8E6YCxoHqI3EX7hJB+3yqjCXGpWWAEOmslkTidZMSfsDNiwOan5yENOdfUr9JOYdae N96sqWym8gkW8WctmsjoAdUwvH25M1+1OeF3Bo0AidndEByqBbZCQgm+4KO4hVTII3qU d+sixLUw77yKcDajnJi2JVyFyEyyM1BEdjTUCxNAwhqVDGALJNgYQ2PvNmaeZsz71mLj kzow== X-Forwarded-Encrypted: i=1; AJvYcCWsh9s3QPkJi4D1jCBcHZGFg9OcePuFZ5t+QT3nOEKJh1PqYPc2afOAheJFWG40sLV/NtaJWfK6k4rzEpKFQ7IWt4KiZCFgJeIRDcdKItZr2zFCnR4= X-Gm-Message-State: AOJu0YxklIT+kgNJvqYSeqY9jGTV2QBrYX73xlNK/gxVaM5stW0PuBYq LOhZUpgJ3jlF6fM2sEsO0x0gbzeHel/IUnMHdPDHtTFFs0zxDwX4 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5lwylk6fhlvqfgxmt7xdoxdrhtvmplo5kazpdbt3kxpnlltxit@v5xbpiv3dnqq> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240616_071635_252355_A75E1021 X-CRM114-Status: GOOD ( 25.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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