lkml.org 
[lkml]   [2021]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 0/3] vfs: Use an xarray instead of inserted bookmarks to scan mount list
On Mon, Mar 15, 2021 at 12:07:39PM +0000, David Howells wrote:
>
> Hi Al, Miklós,
>
> Can we consider replacing the "insert cursor" approach we're currently
> using for proc files to scan the current namespace's mount list[1] with
> something that uses an xarray of mounts indexed by mnt_id?
>
> This has some advantages:
>
> (1) It's simpler. We don't need to insert dummy mount objects as
> bookmarks into the mount list and code that's walking the list doesn't
> have to carefully step over them.
>
> (2) We can use the file position to represent the mnt_id and can jump to
> it directly - ie. using seek() to jump to a mount object by its ID.
>
> (3) It might make it easier to use RCU in future to dump mount entries
> rather than having to take namespace_sem. xarray provides for the
> possibility of tagging entries to say that they're viewable to avoid
> dumping incomplete mount objects.

Usually one fully constructs the object, then inserts it into the XArray.

> But there are a number of disadvantages:
>
> (1) We have to allocate memory to maintain the xarray, which becomes more
> of a problem as mnt_id values get scattered.

mnt_id values don't seem to get particularly scattered. They're allocated
using an IDA, so they stay small (unlike someone using idr_alloc_cyclic
;-).

\
 
 \ /
  Last update: 2021-03-15 13:49    [W:0.092 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site