Re: [PATCH 14/53] sched/headers: Move 'struct user_struct' definition and APIs to the new header

Ingo Molnar
2017-02-08T21:22:53Z

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, Feb 8, 2017 at 10:44 AM, Ingo Molnar <mingo@kernel.org> wrote:
> > 'struct user_struct' was added to sched.h historically, but it's actually
> > entirely independent of task_struct and of scheduler details, so move
> > it to its own header.
>
> Hmm. I wonder if this would make more sense not even under the
> "<linux/sched/xyz>" hierarchy. It has nothing to do with the
> scheduling at all, really.
>
> Small nit and can be left for later.

Yeah. Some of the others could be moved to include/linux/ as well, such as:

<linux/sched/jobctl.h> => <linux/jobctl.h>
<linux/sched/xacct.h> => <linux/xacct.h>
<linux/sched/user.h> => <linux/user.h>

All of these are pretty unrelated to scheduling, they just happen to be about
fields that are in task_struct.

<linux/user.h> already exists, it wraps asm/user.h - I suspect the
<linux/sched/user.h> bits can just be appended to it, plus a header guard.

Thanks,

Ingo