lkml.org 
[lkml]   [2010]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/18] fs: introduce a per-cpu last_ino allocator
On Fri, Oct 08, 2010 at 12:20:19PM +0200, Eric Dumazet wrote:
> If iunique() was scalable, sockets could use it, so that we can have
> hard guarantee two sockets on machine dont have same inum.
>
> A reasonable compromise here is to use a simple and scalable allocator,
> and take the risk two sockets have same inum.
>
> While it might break some applications playing fstats() games, on
> sockets, current schem is vastly faster.
>
> I worked with machines with millions of opened socket concurrently,
> iunique() was not an option, and application didnt care of possible inum
> clash.

The current version of iuniqueue is indeed rather suboptimal. As is
the pure counter approach. I think the right way to deal with it
is to use an idr allocator. This means the filesystem needs to
explicitly free the inode number when the inode is gone, but that
just makes the usage more clear. Together with the lazy assignment
scheme for synthetic filesystems that should give us both speed and
correctness.



\
 
 \ /
  Last update: 2010-10-08 15:51    [W:0.258 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site