Re: [PATCH 14/53] sched/headers: Move 'struct user_struct' definition and APIs to the new <linux/sched/user.h> header

From: Ingo Molnar
Date: Wed Feb 08 2017 - 16:22:56 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, Feb 8, 2017 at 10:44 AM, Ingo Molnar <mingo@xxxxxxxxxx> 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