Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1728094

Re: [PATCH 1/2] pidmap(2)

From Alexey Dobriyan <adobriyan@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] pidmap(2)
Date 2017-09-07 11:50 +0200
Message-ID <un1BD-6At-7@gated-at.bofh.it> (permalink)
References (1 earlier) <umuZ3-IG-3@gated-at.bofh.it> <umv8K-11F-19@gated-at.bofh.it> <umEvp-7XC-33@gated-at.bofh.it> <umUqu-1Kg-9@gated-at.bofh.it> <umXeF-3Gc-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 9/7/17, Djalal Harouni <tixxdz@gmail.com> wrote:
> Hi Alexey,
>
> On Thu, Sep 7, 2017 at 4:04 AM, Andy Lutomirski <luto@amacapital.net>
> wrote:
>> On Wed, Sep 6, 2017 at 2:04 AM, Alexey Dobriyan <adobriyan@gmail.com>
>> wrote:
>>> On 9/6/17, Randy Dunlap <rdunlap@infradead.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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] pidmap(2) Alexey Dobriyan <adobriyan@gmail.com> - 2017-09-05 21:10 +0200
  Re: [PATCH 1/2] pidmap(2) Andrew Morton <akpm@linux-foundation.org> - 2017-09-06 01:00 +0200
    Re: [PATCH 1/2] pidmap(2) Randy Dunlap <rdunlap@infradead.org> - 2017-09-06 01:10 +0200
      Re: [PATCH 1/2] pidmap(2) Thomas Gleixner <tglx@linutronix.de> - 2017-09-06 10:40 +0200
      Re: [PATCH 1/2] pidmap(2) Alexey Dobriyan <adobriyan@gmail.com> - 2017-09-06 11:10 +0200
        Re: [PATCH 1/2] pidmap(2) Andy Lutomirski <luto@amacapital.net> - 2017-09-07 04:10 +0200
          Re: [PATCH 1/2] pidmap(2) Djalal Harouni <tixxdz@gmail.com> - 2017-09-07 07:10 +0200
            Re: [PATCH 1/2] pidmap(2) Alexey Dobriyan <adobriyan@gmail.com> - 2017-09-07 11:50 +0200
          Re: [PATCH 1/2] pidmap(2) Alexey Dobriyan <adobriyan@gmail.com> - 2017-09-07 11:50 +0200
    Re: [PATCH 1/2] pidmap(2) Alexey Dobriyan <adobriyan@gmail.com> - 2017-09-06 11:00 +0200
  Re: [PATCH 1/2] pidmap(2) "Dmitry V. Levin" <ldv@altlinux.org> - 2017-09-07 12:10 +0200

csiph-web