From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EAX2L9u9" Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E347DE; Fri, 1 Dec 2023 02:36:45 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-67a295e40baso10816686d6.1; Fri, 01 Dec 2023 02:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701427004; x=1702031804; 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=+1CSvziGe/qbcOkKXo9IQPR3y1xjDPlILN2WHHl8yYE=; b=EAX2L9u9pfQmtiQ7puEQ0bQB43z+FHTSKdwWQz6a39zOwe3gpcgzjfEF+5Y7TskRLd FX1BpsQzVoIlOwCRdaGNgPpPTEuJX9QwxtTPhDGwrAMv6y9ukma2Gpe6jcOgHSjatRjG UVC4NNVY1W0oXZTh7IDMTGyBqH8/3lrp97xDvVCwTVG19l9toEawUV4tozOqdtTuZ04m vZNiXxWP9QbvUJ+o64gJHnczpgY4HDUG0apuwce8fvX9gyi5e/sW+C8SZ73Maw6pkGMJ ycLz2+ZXk3ZVZ4v4WDpckFSBkmUh7mbyqBxfX4AvR7DtDludtfw2Cy00fkZS/e0xTpMR +gyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701427004; x=1702031804; 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=+1CSvziGe/qbcOkKXo9IQPR3y1xjDPlILN2WHHl8yYE=; b=bxRvzz1mxRIyEifnWIIMZ6L3wgGw8zgYfmGKhFTNW9ilJweSXTv65BO/TvXYsHIF8O WBhFweONX230EnCaRn7yoaLjTJVL0jkpzXn5d4FM8E4ERZeORAI/0oC1uNLvxo0usLT8 6jlOsee3V2LdwXMBnHw1MPKj5+qAOznwhnjpCQanndUYOzLBy6WeC9+Rp3xF8sx0UoWm NE5yvmonjA77vmhbZ1DJamPzNvd1RGmo51RZ9be4B2GqHXSLZvrOwC0E/D9JQJNVxtD8 6DWVR5ucP1vBaYTXka7QWM9q/FfmTjx4PyTZIvrilcLZveL+rB5Yr0d+Qm+V2g8wKq0e o77A== X-Gm-Message-State: AOJu0YxPMRS8BdEIR/aRBaftHe/RLr+QjBygJWrrkqfOIqT2ya4PsKY+ Wj36dzcXYRCq8vYtqtp0sJ8= X-Google-Smtp-Source: AGHT+IH/N7qs1+keta3j5dgaOQn5pnyM0432C78QHFxQAM7OJhtFbhoQVStmruTbCa77V8FDMz+82w== X-Received: by 2002:ad4:42c3:0:b0:67a:4709:34bb with SMTP id f3-20020ad442c3000000b0067a470934bbmr16104179qvr.41.1701427004422; Fri, 01 Dec 2023 02:36:44 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id q20-20020a0cf5d4000000b0067a4452d459sm1380580qvm.116.2023.12.01.02.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:36:44 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 6D28E27C0054; Fri, 1 Dec 2023 05:36:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 01 Dec 2023 05:36:43 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiledgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeelueeiffdugeeliedvjeethfettdeiffffueeiffelhfejgefghedtjedv ffffhfenucffohhmrghinhepghhithhhuhgsrdgtohhmpddttddttddqihhnlhhinhgvqd grshhmrdhmugenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvge ehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhm sehfihigmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Dec 2023 05:36:42 -0500 (EST) Date: Fri, 1 Dec 2023 02:36:40 -0800 From: Boqun Feng To: Peter Zijlstra Cc: Matthew Wilcox , Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Christian Brauner , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Dan Williams , Kees Cook , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org, Josh Triplett Subject: Re: [PATCH 1/7] rust: file: add Rust abstraction for `struct file` Message-ID: References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-1-f81afe8c7261@google.com> <20231129152305.GB23596@noisy.programming.kicks-ass.net> <20231130104226.GB20191@noisy.programming.kicks-ass.net> <20231201085328.GE3818@noisy.programming.kicks-ass.net> <20231201094037.GI3818@noisy.programming.kicks-ass.net> 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: <20231201094037.GI3818@noisy.programming.kicks-ass.net> On Fri, Dec 01, 2023 at 10:40:37AM +0100, Peter Zijlstra wrote: > On Fri, Dec 01, 2023 at 01:19:14AM -0800, Boqun Feng wrote: > > > > > https://github.com/Amanieu/rfcs/blob/inline-asm/text/0000-inline-asm.md#asm-goto > > > > > > Reading that makes all this even worse, apparently rust can't even use > > > memops. > > > > What do you mean by "memops"? > > Above link has the below in "future possibilities": > > "Memory operands > > We could support mem as an alternative to specifying a register class > which would leave the operand in memory and instead produce a memory > address when inserted into the asm string. This would allow generating > more efficient code by taking advantage of addressing modes instead of > using an intermediate register to hold the computed address." > > Just so happens that every x86 atomic block uses memops.. and per-cpu > and ... > Oh yes, I found out Rust's asm! doesn't support specifying a memory location as input or output recently as well. I don't speak for the Rust langauge community, but I think this is something that they should improve. I understand it could be frustrating that we find out the new stuff doesn't support good old tools we use (trust me, I do!), but I believe you also understand that a higher level language can help in some places, for example, SBRM is naturally supported ;-) This answers half of the question: "Why are we even trying to use it again?". The other half is how languages are designed is different in these days: a language community may do a better job on listening to the users and the real use cases can affect the language design in return. While we are doing our own experiment, we might well give that a shot too. And at least the document admits these are "future possibilities", so they should be more motivated to implement these. It's never perfect, but we gotta start somewhere. Regards, Boqun >