[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVxJT_HWMY3ZGqU31aab5Fg-iW61FTb9K64s3KJxOz5J+bANw@mail.gmail.com>
Date: Thu, 7 Sep 2017 12:47:11 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Djalal Harouni <tixxdz@...il.com>
Cc: Andy Lutomirski <luto@...capital.net>,
Randy Dunlap <rdunlap@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Tatsiana Brouka <Tatsiana_Brouka@...m.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
Aliaksandr Patseyenak <Aliaksandr_Patseyenak1@...m.com>,
Alexey Gladkov <gladkov.alexey@...il.com>
Subject: Re: [PATCH 1/2] pidmap(2)
On 9/7/17, Djalal Harouni <tixxdz@...il.com> wrote:
> Hi Alexey,
>
> On Thu, Sep 7, 2017 at 4:04 AM, Andy Lutomirski <luto@...capital.net>
> wrote:
>> On Wed, Sep 6, 2017 at 2:04 AM, Alexey Dobriyan <adobriyan@...il.com>
>> wrote:
>>> On 9/6/17, Randy Dunlap <rdunlap@...radead.org> wrote:
>>>> On 09/05/17 15:53, Andrew Morton wrote:
> [...]
>>>>
>>>> also, I expect that the tiny kernel people will want kconfig options
>>>> for
>>>> these syscalls.
>>>
>>> We'll add it but the question if it is a good idea. Ideally these system
>>> calls
>>> should be mandatory and /proc optional.
>>>
>>> $ size kernel/pidmap.o fs/fdmap.o
>>> text data bss dec hex filename
>>> 560 0 0 560 230 kernel/pidmap.o
>>> 617 0 0 617 269 fs/fdmap.o
>>
>> After much discussion at LPC/KS last year, I thought the idea was to
>> try to speed up /proc rather than replacing it outright. The two
>> specific ideas I recall were:
>>
>> 1. Add a syscall like readfileat() that you can use to, in a single
>> operation, open, read, and close a /proc file (or other file). This
>> should vastly reduce locking and RCU overhead.
>>
>> 2. Add a /proc file that has a nice binary format for task info.
>> (nl_attr?)
>>
>> I don't see why pidmap() deserves to be significantly faster than
>> getdents().
>>
>> Also, a pidmap() syscall like this inherently bypasses any security
>> restrictions implied by the way that /proc is mounted. It can respect
>> hidepid, but hidepid (as a per-namespace concept) is an enormous turd
>> that badly needs to be deprecated, and Djalal is working on exactly
>> that.
>
> Yes as noted by Andy, me and Alexey Gladkov are working on modernizing
> procfs [1] and to reduce/remove ties within pid namespaces which has lot
> of problems now.
> ...
Kudos for digging into this mess.
But the question will remain: how get pids of existing processes quickly.
Powered by blists - more mailing lists