[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f040969-b3b6-8174-7f8e-c8f9db6b80ea@virtuozzo.com>
Date: Tue, 4 Aug 2020 17:47:23 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: Andrei Vagin <avagin@...il.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
viro@...iv.linux.org.uk, adobriyan@...il.com, davem@...emloft.net,
akpm@...ux-foundation.org, christian.brauner@...ntu.com,
areber@...hat.com, serge@...lyn.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
Pavel Tikhomirov <ptikhomirov@...tuozzo.com>
Subject: Re: [PATCH 00/23] proc: Introduce /proc/namespaces/ directory to
expose namespaces lineary
On 04.08.2020 08:43, Andrei Vagin wrote:
> On Thu, Jul 30, 2020 at 06:01:20PM +0300, Kirill Tkhai wrote:
>> On 30.07.2020 17:34, Eric W. Biederman wrote:
>>> Kirill Tkhai <ktkhai@...tuozzo.com> writes:
>>>
>>>> Currently, there is no a way to list or iterate all or subset of namespaces
>>>> in the system. Some namespaces are exposed in /proc/[pid]/ns/ directories,
>>>> but some also may be as open files, which are not attached to a process.
>>>> When a namespace open fd is sent over unix socket and then closed, it is
>>>> impossible to know whether the namespace exists or not.
>>>>
>>>> Also, even if namespace is exposed as attached to a process or as open file,
>>>> iteration over /proc/*/ns/* or /proc/*/fd/* namespaces is not fast, because
>>>> this multiplies at tasks and fds number.
>
> Could you describe with more details when you need to iterate
> namespaces?
>
> There are three ways to hold namespaces.
>
> * processes
> * bind-mounts
> * file descriptors
>
> When CRIU dumps a container, it enumirates all processes, collects file
> descriptors and mounts. This means that we will be able to collect all
> namespaces, doesn't it?
1)It's not only for CRIU. No one util can read content of another task unix socket like CRIU does.
Sometimes we may just want to see all mount namespaces to found a mount, which owns a reference on
a device.
2)In case of CRIU, recursive dump (when you iterate unix socket content, then you find another
namespace and iterate another unix socket content, then you find one more namespace) is less
effective and less fast, then dumping different types sequentially: first namespaces, second fds, etc.
3)It's still impossible to collect all namespaces like Pasha wrote.
Powered by blists - more mailing lists