LKML Archive on
 help / color / Atom feed
From: Geert Uytterhoeven <>
To: Andi Kleen <>
Cc: "" <>,
	"the arch/x86 maintainers" <>,
	Peter Zijlstra <>,
	Andrew Morton <>,
	Andi Kleen <>
Subject: Re: [PATCH 3/6] tree-sweep: Include linux/sched.h for might_sleep users
Date: Sat, 31 Aug 2013 20:22:23 +0200
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Aug 16, 2013 at 11:17 PM, Andi Kleen <> wrote:
> might_sleep is moving from linux/kernel.h to linux/sched.h, so any users
> need to include linux/sched.h

Really? <linux/sched.h> is the worst choice w.r.t. include hell.

> This was done with a mechanistic script and some uses may be redundant
> (already included in some other include file). However it's good practice
> to always include any needed symbols from the top level .c file.
> Tested with x86-64 allyesconfig. I used to do a x86-32 allyesconfig
> on a old kernel, but since that is broken now I didn't retest.
> Signed-off-by: Andi Kleen <>

> diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h
> index 5372787..274c9c2 100644
> --- a/arch/mn10300/include/asm/uaccess.h
> +++ b/arch/mn10300/include/asm/uaccess.h
> @@ -14,6 +14,7 @@
>  /*
>   * User space memory access functions
>   */
> +#include <linux/sched.h>
>  #include <linux/thread_info.h>
>  #include <linux/kernel.h>
>  #include <asm/page.h>

This part breaks mn10300:

  CC      init/version.o
In file included from linux-next/include/linux/timex.h:56:0,
                 from linux-next/include/linux/sched.h:17,
                 from linux-next/arch/mn10300/include/asm/uaccess.h:17,
                 from linux-next/arch/mn10300/include/asm/processor.h:21,
                 from linux-next/include/linux/spinlock_up.h:8,
                 from linux-next/include/linux/spinlock.h:89,
                 from linux-next/include/linux/seqlock.h:29,
                 from linux-next/include/linux/time.h:5,
                 from linux-next/include/linux/stat.h:18,
                 from linux-next/include/linux/module.h:10,
                 from linux-next/init/version.c:10:
linux-next/include/uapi/linux/timex.h:76:17: error: field 'time' has
incomplete type

Note that it doesn't use might_sleep(). It does use might_fault(), but only from
a macro, not from a C inline function.



Geert Uytterhoeven -- There's lots of Linux beyond ia32 --

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 21:17 Improve preempt-scheduling and x86 user access v3 Andi Kleen
2013-08-16 21:17 ` [PATCH 1/6] x86: Add 1/2/4/8 byte optimization to 64bit __copy_{from,to}_user_inatomic Andi Kleen
2013-09-10 23:30   ` [tip:x86/uaccess] x86: Add 1/2/4/ 8 " tip-bot for Andi Kleen
2013-08-16 21:17 ` [PATCH 2/6] x86: Include linux/sched.h in asm/uaccess.h Andi Kleen
2013-08-16 21:17 ` [PATCH 3/6] tree-sweep: Include linux/sched.h for might_sleep users Andi Kleen
2013-08-31 18:22   ` Geert Uytterhoeven [this message]
2013-09-10 23:52     ` Andrew Morton
2013-09-11  4:51       ` Andi Kleen
2013-09-11  5:36         ` Ingo Molnar
2013-08-16 21:17 ` [PATCH 4/6] Move might_sleep and friends from kernel.h to sched.h Andi Kleen
2013-08-27 23:50   ` Andrew Morton
2013-08-16 21:17 ` [PATCH 5/6] sched: mark should_resched() __always_inline Andi Kleen
2013-08-16 21:17 ` [PATCH 6/6] sched: Inline the need_resched test into the caller for _cond_resched Andi Kleen
2013-08-28  9:29 ` Improve preempt-scheduling and x86 user access v3 Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone