[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180717115952.GA29647@redhat.com>
Date: Tue, 17 Jul 2018 13:59:52 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Wen Yang <wen.yang99@....com.cn>,
majiang <ma.jiang@....com.cn>
Subject: Re: [RFC][PATCH 05/11] pids: Move the pgrp and session pid pointers
from task_struct to signal_struct
This is a bit offtopic/cosmetic and we can do this later, just for record
before I forget this...
On 07/10, Eric W. Biederman wrote:
>
> +static struct pid **task_pid_ptr(struct task_struct *task, enum pid_type type)
> +{
> + return (type == PIDTYPE_PID) ?
> + &task->thread_pid :
> + (type == __PIDTYPE_TGID) ?
> + &task->signal->leader_pid :
> + &task->signal->pids[type];
> +}
This new helper is (simplified after you removed __PIDTYPE_TGID/leader_pid) can
have more users: task_pid_type(), init_task_pid(). In fact even (say) task_tgid()
can use it if we export it inline.
And if we make task_pid_ptr() the only user of signal->pids[] array we can shrink
it, signal->pids[0] is not used. Or may be we can simply redefine enum pid_type,
we can define PIDTYPE_PID == -1 or move it at the end, or do something else.
Once again, this is just random/minor thoughts, feel free to ignore.
Oleg.
Powered by blists - more mailing lists