From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 201992E7F11 for ; Fri, 21 Nov 2025 17:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763747275; cv=none; b=W68/UtFnBiJV0+AN3y+k/XIzORlPbaAgMQ0DY/AFYEWwC9VhPDQgisg4I2M9yQEmxzl2MAJba2rmluZo1cG3kDrp1j0emjQgidCEDz3kHKYUXYjcbZoyAozOBXc5w9e/flA/uVuVsjRWJ4omGSJGq5C070QPtNn6rrIUfpxZT4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763747275; c=relaxed/simple; bh=6e/UwWDrkYY4rcwFriN7U3gZO7rE2iKERAumY8yNN0o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TNtdfoNL354vg/5lUQ5h7O85i/kU1R+qKEcPaYsnaO8uH0MXwE/AqFvQ2D8yIZuqz5Cq5V6K80GjU1PaSGXloSB4lCH5prmiNGhzxH+fI0RXPmbSbjEMP6XfiK+pHMI1/eliXq31hth9mbMGYBxa/pQI8U8fNKbDvVH65jebxto= 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=Yyhvz04u; arc=none smtp.client-ip=209.85.219.47 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="Yyhvz04u" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-88054872394so30750706d6.1 for ; Fri, 21 Nov 2025 09:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763747273; x=1764352073; 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=Qfpp2UWop0AGuC9XzBRWqbFMhIKY/BIXGgpLtosV1TE=; b=Yyhvz04u6Qe0h/+oL1aVuEmASiZejFJLyQjRCAwcnpUQjdoY9YQy4iJTlWd/MKwwZQ 4sg7iJF6iqTs07OM1SKAlXNMCny+rkV8F0CbwbiNwlA/Olo22LwmQ8cmHXLtav8qngy6 DQTqAY0drFSr+xduQoCiA5UYXmRQa1rRJJfxoRCgHWfKbs6MS2u/h++h+tHQtWM1YgBO SIVYya73jDRY7rk1FqGmbIQVWF5EPjn+UQT7fMmRcEf/H3Q5zfyQ340FzavWdOrxjgcv i62TdoxJM0kS6MRC//2h7JU7YpnlahsOO3iMBT0w5wbUiEMuHuWxqpBiH1aQVrPM2ge2 0UWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763747273; x=1764352073; 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=Qfpp2UWop0AGuC9XzBRWqbFMhIKY/BIXGgpLtosV1TE=; b=EO8jNH+XixuszreZAwqJzkNb7llexu83HBCsB6FfwRZfyrsFEBDw06CQmJFPtSztAi ucXCvXS8RQRc6BHz3PJGU6c3DOJ/hdjtmjnS/X4D6PDX3IA59vQ52T6jaPpYlCuEeuOU fZzDCLOlURoFDVacKi+CXwoBlyWXhR/kAsVMw7BN+2LbHnjDaoY2pTwBQGarAQr/YjwD MFzBktM00tsFZtSvBs2CKB+LybuiJsp9O5/B234BFzhfbr1B1n36ruZF8Utx/NmIZ8nQ XtfKNLFJIhz5OYwvirCuQMBbOIhm6lWejsPHLCpYm5PCdmu1nuMnw9J6Cyypnwecovp4 dnDg== X-Forwarded-Encrypted: i=1; AJvYcCWyds6s643L/EZVRM23dexySj6sTdTNwARjbUsa+M/XtcQUDnhsZW60FdZxe9wobyamwFXwGUUWsJnAVso=@vger.kernel.org X-Gm-Message-State: AOJu0YwniM0AmLyndxUxaHvRU0LdAK0I3Vw4Ta4Rq4S/nJbtLHJPCrRN iWGHo+ta6lEKsZSpD6dHa/0eSP7Fjkl0pU9+tgJk1l/cZm1SLP7MIxI4 X-Gm-Gg: ASbGncuPPCCNOuLIm2tWb4uySoOExOcgXFQ1kgioADDuF/Mf2Kz7+EA9gQQtCIa86Ie qDDYyJQVSS42Up8pfrJpdK0TCFUZUs3X+1PKhoCCI/nIDUVKRUqfAYPrqdsBWJOLvWKbK148H6q rBUI89TCYadCrPRNF/5Zvi3CWuYpuXcSNGs6kj5NTEqgwl1fnQwBAVWIhqi/qg4ux50WetePYOb rCNAhHFZJuAUZJe+bN7dyLCzy3NhoHfXEL630qar87YtnlI1Md4prJQwyYoSus05XC64cL3Ch0R pNxtrarW5cAbHGntCg0jJaUi0t/Of96voDxO7Xy2L2iwZsd/9aLOx/vLSBalLJr8ET6gquc9lMg 2OIF5jW4RW7D9VmGJC+G893EFeYA9temopWdQrBOU0HCoX5lkttYBHoBEaHKoZhxGVLvnVcbVdf dlAuTAV5Z90bBHVLQGpHZ14G28MjB2OrtoSbqM6dwMWyl1k5PfCI42G5SAGo8kYNs8tnD4vByYA 5vDaZy2sNXAfqs= X-Google-Smtp-Source: AGHT+IGTGzyylYtE/+GD3lyq/A7F5Zl2dQaZnS82McCJDJvMOCd+WqcaRUtSyVWJnj2ALgFUeXxU9A== X-Received: by 2002:a05:6214:3f93:b0:880:46b6:fe3b with SMTP id 6a1803df08f44-8847c536770mr48750776d6.53.1763747273005; Fri, 21 Nov 2025 09:47:53 -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-8846e446458sm42502526d6.12.2025.11.21.09.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 09:47:52 -0800 (PST) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 9C8B5F40084; Fri, 21 Nov 2025 12:47:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 21 Nov 2025 12:47:51 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvfedtiedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefhtedvgfdtueekvdekieetieetjeeihedvteehuddujedvkedtkeefgedvvdeh tdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedvuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhhuhgssggrrhgusehnvh hiughirgdrtghomhdprhgtphhtthhopehlhihuuggvsehrvgguhhgrthdrtghomhdprhgt phhtthhopehruhhsthdqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhr ghdprhgtphhtthhopehtghhlgieslhhinhhuthhrohhnihigrdguvgdprhgtphhtthhope gurghnihgvlhdrrghlmhgvihgurgestgholhhlrggsohhrrgdrtghomhdprhgtphhtthho pehojhgvuggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegrlhgvgidrghgrhihnoh hrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepghgrrhihsehgrghrhihguhhordhnvght X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Nov 2025 12:47:50 -0500 (EST) Date: Fri, 21 Nov 2025 09:47:49 -0800 From: Boqun Feng To: John Hubbard Cc: Lyude Paul , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Daniel Almeida , Miguel Ojeda , Alex Gaynor , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Andrew Morton , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long Subject: Re: [PATCH v14 00/16] Refcounted interrupts, SpinLockIrq for rust Message-ID: References: <20251120214616.14386-1-lyude@redhat.com> <4b6ae41e-5cda-41ab-ba4e-628bdf23f917@nvidia.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: <4b6ae41e-5cda-41ab-ba4e-628bdf23f917@nvidia.com> On Thu, Nov 20, 2025 at 03:16:04PM -0800, John Hubbard wrote: > On 11/20/25 1:45 PM, Lyude Paul wrote: > ... > > this new interface is indeed possible, more on this below. > > * Also thank to Joel, we also now have actual benchmarks for how this > > affects performance: > > https://lore.kernel.org/rust-for-linux/20250619175335.2905836-1-joelagnelf@nvidia.com/ > > * Also some small changes to the kunit test I added, mainly just making > > sure I don't forget to include a MODULE_DESCRIPTION or MODULE_LICENSE. > > Hi, > > The above link says that local_interrupt takes 3.6x as as as local_irq. > > This is alarming, but is it the final word? In other words, is the Rust > side of this doomed to slower performance forever, or is there some > hope of reaching performance parity with the C part of the kernel? > Note that local_interrupt API is for safe Rust code, you can always use unsafe local_irq if the interrupt disabling is the performance bottleneck for you. So language-wise there is no difference between Rust and C. > Do we have to start telling the Rust for Linux story this way: "our > new Rust-based drivers are slower, but memory-safer"? > I would not jump into that conclusion at the moment, because 1) as I mentioned you can always go into unsafe if something begins the bottleneck, and 2) there is always a gap between micro benchmark results and the whole system performance, being slow on one operation doesn't means the whole system will perform observably worse. Think about a similar thing in C, we recommend people to use existing locks instead of customized synchronization vi atomics in most cases, and technically, locks can be slower compared to a special synchronization based on atomics, but it's more difficult to mess up. Regards, Boqun > I'm not able to deduce the answer from a quick scan through the patches > and the cover letter. > > thanks, > -- > John Hubbard >