diff mbox

sched/autogroup: move sched.h include

Message ID 20171208082422.5021-1-sergey.senozhatsky@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sergey Senozhatsky Dec. 8, 2017, 8:24 a.m. UTC
Move local "sched.h" include to the bottom. sched.h defines
several macros that are getting redefined in ARCH-specific
code, for instance, finish_arch_post_lock_switch() and
prepare_arch_switch(), so we need ARCH-specific definitions
to come in first.

Suggested-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 kernel/sched/autogroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Petr Mladek Dec. 8, 2017, 8:57 a.m. UTC | #1
On Fri 2017-12-08 17:24:22, Sergey Senozhatsky wrote:
> Move local "sched.h" include to the bottom. sched.h defines
> several macros that are getting redefined in ARCH-specific
> code, for instance, finish_arch_post_lock_switch() and
> prepare_arch_switch(), so we need ARCH-specific definitions
> to come in first.

This patch is needed to fix compilation error [1] caused by a patchset
that deprecates %pf/%pF printk modifiers[2].

IMHO, we should make sure that this fix goes into Linus' tree
before the printk-related patchset. What is the best practice,
please?

I see two reasonable possibilities. Either sched people could
push this for-4.15-rcX. Or I could put it into printk.git for-4.16
in the right order.

What do you think?

Referece:
[0] http://lkml.kernel.org/r/201712080259.tvO64XfA%fengguang.wu@intel.com
[1] https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-next&id=98fff2c57b7e88d643cb42ffd910fe9905b33176

Best Regards,
Petr
Sergey Senozhatsky Dec. 8, 2017, 10:39 a.m. UTC | #2
Hi,

On (12/08/17 09:57), Petr Mladek wrote:
> On Fri 2017-12-08 17:24:22, Sergey Senozhatsky wrote:
> > Move local "sched.h" include to the bottom. sched.h defines
> > several macros that are getting redefined in ARCH-specific
> > code, for instance, finish_arch_post_lock_switch() and
> > prepare_arch_switch(), so we need ARCH-specific definitions
> > to come in first.
> 
> This patch is needed to fix compilation error [1] caused by a patchset
> that deprecates %pf/%pF printk modifiers[2].
> 
> IMHO, we should make sure that this fix goes into Linus' tree
> before the printk-related patchset. What is the best practice,
> please?

as long as sched pull request goes before printk pull request we
are fine. but I see your point.

> I see two reasonable possibilities. Either sched people could
> push this for-4.15-rcX. Or I could put it into printk.git for-4.16
> in the right order.

agreed.

> What do you think?

either way is fine with me. we can have it in print.git (no objections
from my side) or in sched tree and just make sure that sched pull request
has "bigger priority", or it can go to Linus's tree as a potential fix
(I'd prefer the last option, I think).

	-ss
Peter Zijlstra Dec. 8, 2017, 10:56 a.m. UTC | #3
On Fri, Dec 08, 2017 at 05:24:22PM +0900, Sergey Senozhatsky wrote:
> Move local "sched.h" include to the bottom. sched.h defines
> several macros that are getting redefined in ARCH-specific
> code, for instance, finish_arch_post_lock_switch() and
> prepare_arch_switch(), so we need ARCH-specific definitions
> to come in first.
> 
> Suggested-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  kernel/sched/autogroup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c
> index 0786227a3f48..bb4b9fe026a1 100644
> --- a/kernel/sched/autogroup.c
> +++ b/kernel/sched/autogroup.c
> @@ -1,12 +1,12 @@
>  // SPDX-License-Identifier: GPL-2.0
> -#include "sched.h"
> -
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
>  #include <linux/utsname.h>
>  #include <linux/security.h>
>  #include <linux/export.h>
>  
> +#include "sched.h"
> +
>  unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
>  static struct autogroup autogroup_default;
>  static atomic_t autogroup_seq_nr;
> -- 
> 2.15.1
>
diff mbox

Patch

diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c
index 0786227a3f48..bb4b9fe026a1 100644
--- a/kernel/sched/autogroup.c
+++ b/kernel/sched/autogroup.c
@@ -1,12 +1,12 @@ 
 // SPDX-License-Identifier: GPL-2.0
-#include "sched.h"
-
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/utsname.h>
 #include <linux/security.h>
 #include <linux/export.h>
 
+#include "sched.h"
+
 unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
 static struct autogroup autogroup_default;
 static atomic_t autogroup_seq_nr;