Re: [PATCH] fuse: replace passthrough backing-id IDR with IDA plus hashtable
From: Amir Goldstein
Date: Mon Jun 22 2026 - 04:11:57 EST
On Mon, Jun 22, 2026 at 9:25 AM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Sun, 21 Jun 2026 at 20:32, Mahad Ibrahim <mahad.ibrahim.dev@xxxxxxxxx> wrote:
>
> > Replace the IDR with an IDA for id allocation and a separate hashtable for
> > the id-to-pointer lookup. The IDA needs far less memory per id; the
> > hashtable adds a fixed per-connection cost. The net effect is a space win
> > that grows with the number of live backings, as quantified below.
>
> But why use IDA at all? A simple cyclic counter should be sufficient.
> Collisions (which should be rare) can be avoided via hash table
> lookup.
>
Also, we were considering widening backing_id to 64bit and allow for
user assigned id's, so if we are dropping IDR/IDA it's a good opportunity
to remove the INT_MAX limit, but we'd still need a 32bit allocator mode
for the legacy backing id.
Thanks,
Amir.