From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (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 E39563ED5D0 for ; Thu, 9 Jul 2026 09:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783587691; cv=none; b=uTCtoaXLGwRcrFkjVDtMoG9t+peFDAD4kD6elBIA+ZPwkFJM1GtcXh2fAJT8FBOvJIH7wMR76ahPKW8+I4TyRpNi1/fe7Blb47lVQG3YNXs0zH9VLRukNWWq4V5mw3vLW765ADEkq1Qtb6Ryl9wOQ3dRtEvjr5cOcuh1wKJEIpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783587691; c=relaxed/simple; bh=zGyveR2WbexIXAL5cH6LAz1O8Yy1Bgi6o6rA6JtFqEc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ayrx7KCM2VGBX5xjx94jqK2QvzBPwSdI26Eqq9gH1F6t8aRnrEaiYoUp6q5YCyJ0i2+7sUJlAvEMXO805GaU7hroYKS7wtJNuhyHz2aWu2EVNwXfqMmyYO8+VGoFrXzy4DFOIezUVeCmwoLlfTirf7nozLxyPa2ur2yufZZE+LQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gkSgL9ap; arc=none smtp.client-ip=209.85.208.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gkSgL9ap" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-698af52daa4so2307923a12.0 for ; Thu, 09 Jul 2026 02:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783587688; x=1784192488; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cKWh2FN+uopuAMuLcrvUAZLjx2pCwGenf//G8cQsjMQ=; b=gkSgL9apR7y+iMBXru722gl6bNjk0pDunLr8nm4cL9PIhBj35NSRXdpspNsxETxb2e 77MiaIcnAFL1IrLI91bf9Visv92kW3n/AlXobUKJ8bz3NL4aUY8ARzveVjY+U7USEhhB FtPnrnq8OQTbdC25cOgmpdVP21LZUN5rSEXUORwqPdViyGBp+0C2NI82FDqOnXrx3FK5 BmcU9XKewCo2HaieMIEq6VFahz1QUfDDNWQPhlV9ePF3v9jFjxG7htLv5B8U+gzqCMXG wt8zQFl6LtKiOAcGQMGCoPpfL86mGoIqY3SrTIFZLSX8SAmryHWqplVGpNnGpcFQdSW2 Ttaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783587688; x=1784192488; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cKWh2FN+uopuAMuLcrvUAZLjx2pCwGenf//G8cQsjMQ=; b=CvYVq8zBAnFjXNvuxNENXsE6Ai1Ok4+oqUMXzCyNRrKEitwXPcBNKI7Fsd2NZPZJdb s3F4zVLyzFzxpO+jSj8kzcpinuDJ2QHJjLz2XRu80YfLfAZ1VyTFHNcvf591qLkdePxd Wtmz2QYM47EqR3LZvYb4OORRZ/4fRqjm5NkiztsAAw/5as4WdKf6jgUg2FpKsEAelKxh EJ0Pmi1XHK1XT5TS4QLSYK6PVjgwM8wymgdYPQGPku8/8N/zUuTp+2xrCt7Hcuy02hn2 C+Lp6CoMAZhdureZv38iHQfBh5NBUKRf0v5s61dY7oMmM6m8M3jrsIBK2m0nTn1ubo/R OsCA== X-Forwarded-Encrypted: i=1; AHgh+RqrtawgPrviroU3dudzW3IhjwYR4uxt92IU5EyEI3JM97Lp6/AJALYskAMPAP7JfMMY+L2aRGejrqZcKOw=@vger.kernel.org X-Gm-Message-State: AOJu0Yyj97J3GWeTROh1W4RXQW6R6ZP/ktpwDmJyyIi86zT6PBcQ9GP9 aYoaw1Bsq/OZ970+tsNFDbXXPzXVC71b74E+bBDz0n0XLO+zB7JL/sp9XwduC4GPQ7omFo4PEiu ASWJPjk3d8GXhuO+CGg== X-Received: from edfg18-n1.prod.google.com ([2002:a05:6402:a252:10b0:69b:3a15:6755]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:2b9b:b0:69a:57fb:4783 with SMTP id 4fb4d7f45d1cf-69ab445ed4cmr2326024a12.13.1783587687331; Thu, 09 Jul 2026 02:01:27 -0700 (PDT) Date: Thu, 9 Jul 2026 09:01:25 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260703-chid-v1-0-84fe8259e46e@nvidia.com> <20260703-chid-v1-2-84fe8259e46e@nvidia.com> Message-ID: Subject: Re: [PATCH 2/4] rust: bitmap: add contiguous area operations From: Alice Ryhl To: Gary Guo Cc: Yury Norov , Eliot Courtney , Burak Emir , Yury Norov , Miguel Ojeda , Boqun Feng , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , "Onur =?utf-8?B?w5Z6a2Fu?=" , David Airlie , Simona Vetter , John Hubbard , Alistair Popple , Timur Tabi , Zhi Wang , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="utf-8" On Mon, Jul 06, 2026 at 07:22:27PM +0100, Gary Guo wrote: > On Mon Jul 6, 2026 at 6:21 PM BST, Alice Ryhl wrote: > > On Mon, Jul 06, 2026 at 12:29:00PM -0400, Yury Norov wrote: > >> All three are the wrappers around the regular outline functions: > >> bitmap_find_next_zero_area_off(), __bitmap_set() and __bitmap_clear(). > >> > >> The inlined version in headers is optimized for small bitmaps. But the > >> optimization is all based on inlining in the C code. It doesn't work > >> if you wrap it with a rust helper. > >> > >> There was a discussion about the similar find_next_bit(). The function > >> itself is an inliner, but it's a wrapper around the true outlined > >> _find_next_bit(). So we decided to minimize the binder size for that > >> type of functions. > >> > >> Please, keep the binder minimal unless necessary. > > > > If we can just call __bitmap_clear() without any downsides, then I agree > > we should do that, but we actually do support inlining the helpers now. > > See CONFIG_RUST_INLINE_HELPERS. > > bitmap uses __builtin_constant_p which will only work with pure C inlining and > not LLVM IR based inlining. Ack in that case using __bitmap_clear() from Rust definitely makes sense. Thanks Alice