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 1781041A76E for ; Mon, 6 Jul 2026 12:46:51 +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=1783342015; cv=none; b=u8B5j98fIKNm7xTUUWoK01Uj7WXzXpPWVPcB/qCcNMfugWv8RRAmn2HBnOw7somf7SMZ2ZX7BsXQG37SCBGBVciOOwIhbFEjCJ7EhMPcJDr/v4OL5Pru8EPMbVRorXOGmhrQfhkYDWOv5PhEMjGGt3diGv/V1ZrmKzcJ0WzbGLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783342015; c=relaxed/simple; bh=/dqoTYg6+fCxwhN0KROjyyeiU+qZU4d6g5TG3/SL/p0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=N0Ybbfz3wVN7n9MCcpMbRsie9CpFFHzyuak2+Bw50/13vBIfSU26J9/kSoYeUoIC8dfgWArOC+nqUKG+TZ6UMlOkumigjBP95COZlk3zXIK2shjQFkDcDb4y8UWMxUsJyCye1xD3fNCQ8M9rBv9/pyh96KFQ/H2iA2nmDxy0gF8= 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=p3WL0r4j; 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="p3WL0r4j" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-6983e9f38e6so2387674a12.0 for ; Mon, 06 Jul 2026 05:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783342010; x=1783946810; 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=w4Q98ESFsm5V2q2RxX/fy6rfondgx2jkzF1eEys7nYs=; b=p3WL0r4jK7ulPYSusgEJ/R8hBMqWT6mBxeyHjqBHeRNJbFi69SWkRl/M2/TGe6d5/a jatqQOxwHzsX/OIE6gTPOY+JXSBiafM+Ln/go62tCShJqC/7ZVExqdZAEtWSsUnHTcuG sPbGJyG1L2twOKbKxwG0zrvshpaG6cKUlXWpaiNlrvJ4WAFqbDKjiVMEQfEzDC7AQMTy CZZlOkN7LLidDpp9Up1wFW6L41sdTagTtUOWV60eUtZaP0dvpzQrJB+DI5CMU1mI4cjq wCFXVbYAkHALs1gGGBUV/7NKfJYv5dOWgZGvY/xT7FSNG6f/HrrJZgfW+je48//DkC+h 3/SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783342010; x=1783946810; 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=w4Q98ESFsm5V2q2RxX/fy6rfondgx2jkzF1eEys7nYs=; b=e0cixjBQW+x7k17yV1qPb90yXV7tgG0PRqxOu9fdJO3yYO+Vlpykzs4lqE291amLLS cCixVqnkwHd5UGCuUd5wN+kiaRJdEQLuRqhelXH8iHZn+TNCVirserd6dC09T9jYsDQw lWftu2DrJgKvVg4u+T+jIQoe0Bh5BDHjXa2OUiyhV6VFkY/YSfBNSfzKjUPRh179+H42 Jv68l8DrqgDfOzoQ1mTEGIXiXotl8ja2eAJ6ZgDPcKRf5cY+3N7kfr+b5pWVESCMVoCX XvEydXCeDEfOOzW0UZMWLMaN7g/mefEkel2xVxzPQIajlpnJ0vBLVIuSVIQ2hEBiZ2d7 aVKQ== X-Forwarded-Encrypted: i=1; AHgh+RqrnxUtCN95Y+z78DKdocxvERMdI+Rj0xk+ubQkQC7Um/tob1PDzrWIvY1XvwOO2z6mV+AME2Yy5fdQl1M=@vger.kernel.org X-Gm-Message-State: AOJu0YzySN+i556E+NrEN0EUF3MLMhmHcx6AccxpxPCsISE3jVs1e6Gg F4ii0A4CCYTd4igINQN2MRW3P6eJqkXGoX8eVc/YVee5d+YVnRCP9QKxHzbq2VGR1spy4wsAYFI iMnFd+hMDoQBD8oFL9Q== X-Received: from edbev14.prod.google.com ([2002:a05:6402:540e:b0:699:e9c6:5556]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:4015:b0:698:ad7f:9383 with SMTP id 4fb4d7f45d1cf-69a85b93b10mr266244a12.14.1783342009416; Mon, 06 Jul 2026 05:46:49 -0700 (PDT) Date: Mon, 6 Jul 2026 12:46:48 +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> Message-ID: Subject: Re: [PATCH 0/4] rust: Add support for reserving of ranges of IDs From: Alice Ryhl To: Gary Guo Cc: 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 12:53:24PM +0100, Gary Guo wrote: > On Mon Jul 6, 2026 at 12:48 PM BST, Alice Ryhl wrote: > > On Fri, Jul 03, 2026 at 07:16:03PM +0900, Eliot Courtney wrote: > >> Add support for reserving of ranges of IDs, with a usage in nova-core > >> for channel IDs. This entails adding the helpers+users of the C bitmap > >> API for ranges of bits, then users of that in `IdPool`, and finally a > >> user of `IdPool` in nova-core, `ChannelIdPool`. > > > > If you need ranges of IDs, perhaps you want the maple tree instead? > > > > Alice > > Any reason that the current ID pool is implemented directly on top of bitmap > rather than using IDA? To some extent it's because that's how C Binder did it. Though I do also think that the bitmap fits binder's needs pretty well. Almost no Binder processes will have more than 8 handles in use, in which case the BitmapVec is extremely efficient because no allocation or pointer indirection is used. And the bitmap also performs well for the few processes with many external handles. But it could also use the xarray instead. Nothing stopping that. Alice