Re: [PATCH v3 5/6] pid: perform free_pid() calls outside of tasklist_lock
From: Oleg Nesterov
Date: Mon Feb 03 2025 - 15:03:18 EST
On 02/03, Mateusz Guzik wrote:
>
> On Mon, Feb 3, 2025 at 7:49 PM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >
> > To avoid the confusion, my question and a note are absolutely offtopic.
> >
> > On 02/01, Mateusz Guzik wrote:
> > >
> > > @@ -1085,6 +1085,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
> > > {
> > > struct task_struct *p;
> > > struct task_struct *group_leader = current->group_leader;
> > > + struct pid *pids[PIDTYPE_MAX] = { 0 };
> >
> > Could you remind me why
> >
> > struct pid *pids[PIDTYPE_MAX] = {};
> >
> > is not right? I seem to knew it some time before, but can't recall...
> >
>
> as far as I know this is merely a matter of convention, fwiw a naive grep:
> $ git grep '= { }' | wc -l
> 1273
> $ git grep '= { 0 }' | wc -l
> 2031
> $ git grep '= {}' | wc -l
> 5626
OK... but I still have a vague feeling that it was explained somewhere
that '{ 0 }' should be preferred... Nevermind.
> that said i can change it to whatever you see fit
No, please do whatever looks better to you.
Oleg.