Re: [PATCH v2] Add /proc/pid_gen

2018-11-22 Thread Mathieu Desnoyers
- On Nov 21, 2018, at 7:30 PM, Daniel Colascione dan...@google.com wrote: [...] >> > > >> > > The problem here is the possibility of confusion, even if it's rare. >> > > Does the naive approach of just walking /proc and ignoring the >> > > possibility of PID reuse races work most of the time? S

Re: [PATCH v2] Add /proc/pid_gen

2018-11-22 Thread Cyrill Gorcunov
On Wed, Nov 21, 2018 at 04:35:34PM -0700, Andy Lutomirski wrote: > > > > I'm going to have Android's systrace and Perfetto use this approach. > > Exactly how many tools signed up to use this feature do you need? > > > >> Those people are the intended audience and the > >> best-positioned reviewer

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 6:36 PM Tim Murray wrote: > > On Wed, Nov 21, 2018 at 5:29 PM Andrew Morton > wrote: > > > > On Wed, 21 Nov 2018 17:08:08 -0800 Daniel Colascione > > wrote: > > > > > Have you done much > > > retrospective long trace analysis? > > > > No. Have you? > > > > Of course yo

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Tim Murray
On Wed, Nov 21, 2018 at 5:29 PM Andrew Morton wrote: > > On Wed, 21 Nov 2018 17:08:08 -0800 Daniel Colascione > wrote: > > > Have you done much > > retrospective long trace analysis? > > No. Have you? > > Of course you have, which is why I and others are dependent upon you to > explain why this

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 17:08:08 -0800 Daniel Colascione wrote: > Have you done much > retrospective long trace analysis? No. Have you? Of course you have, which is why I and others are dependent upon you to explain why this change is worth adding to Linux. If this thing solves a problem which we

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 4:57 PM Andrew Morton wrote: > > On Wed, 21 Nov 2018 16:28:56 -0800 Daniel Colascione > wrote: > > > > > The problem here is the possibility of confusion, even if it's rare. > > > > Does the naive approach of just walking /proc and ignoring the > > > > possibility of PID

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 16:28:56 -0800 Daniel Colascione wrote: > > > The problem here is the possibility of confusion, even if it's rare. > > > Does the naive approach of just walking /proc and ignoring the > > > possibility of PID reuse races work most of the time? Sure. But "most > > > of the time

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 4:28 PM Daniel Colascione wrote: > > On Wed, Nov 21, 2018 at 4:22 PM Andrew Morton > wrote: > > > > On Wed, 21 Nov 2018 15:21:40 -0800 Daniel Colascione > > wrote: > > > > > On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton > > > wrote: > > > > > > > > On Wed, 21 Nov 2018

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 4:22 PM Andrew Morton wrote: > > On Wed, 21 Nov 2018 15:21:40 -0800 Daniel Colascione > wrote: > > > On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton > > wrote: > > > > > > On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione > > > wrote: > > > > > > > On Wed, Nov 21, 20

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 15:21:40 -0800 Daniel Colascione wrote: > On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton > wrote: > > > > On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione > > wrote: > > > > > On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton > > > wrote: > > ... > > > > I wouldn't call t

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 3:35 PM Andy Lutomirski wrote: > > On Nov 21, 2018, at 4:21 PM, Daniel Colascione wrote: > > > >> On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton > >> wrote: > >> > >>> On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione > >>> wrote: > >>> > On Wed, Nov 21, 2018 at

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andy Lutomirski
> On Nov 21, 2018, at 4:21 PM, Daniel Colascione wrote: > >> On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton >> wrote: >> >>> On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione >>> wrote: >>> On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton wrote: > On Wed, 21 Nov 2018

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 2:50 PM Andrew Morton wrote: > > On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione > wrote: > > > On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton > > wrote: > > > > > > On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione > > > wrote: > > > > > > > Trace analysis cod

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 2:49 PM Jann Horn wrote: > > On Wed, Nov 21, 2018 at 11:40 PM Daniel Colascione wrote: > > On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton > > wrote: > > > On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione > > > wrote: > > > > +u64 read_pid_generation(struct pid_names

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 14:40:28 -0800 Daniel Colascione wrote: > On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton > wrote: > > > > On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione > > wrote: > > > > > Trace analysis code needs a coherent picture of the set of processes > > > and threads running

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Jann Horn
On Wed, Nov 21, 2018 at 11:40 PM Daniel Colascione wrote: > On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton > wrote: > > On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione > > wrote: > > > +u64 read_pid_generation(struct pid_namespace *ns) > > > +{ > > > + u64 generation; > > > + > > > + >

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Daniel Colascione
On Wed, Nov 21, 2018 at 2:12 PM Andrew Morton wrote: > > On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione > wrote: > > > Trace analysis code needs a coherent picture of the set of processes > > and threads running on a system. While it's possible to enumerate all > > tasks via /proc, this en

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione wrote: > Trace analysis code needs a coherent picture of the set of processes > and threads running on a system. While it's possible to enumerate all > tasks via /proc, this enumeration is not atomic. If PID numbering > rolls over during snapsh