sched: Use WARN_ONCE for the might_sleep() TASK_RUNNING test
authorPeter Zijlstra <peterz@infradead.org>
Wed, 29 Oct 2014 16:08:45 +0000 (17:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2014 06:17:49 +0000 (07:17 +0100)
In some cases this can trigger a true flood of output.

Requested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c

index b9f78f12ac22ec706878d9965eff6d132c778f02..0cd34e68680cab320080babdf1d5723f8fef4cdf 100644 (file)
@@ -7301,7 +7301,7 @@ void __might_sleep(const char *file, int line, int preempt_offset)
         * since we will exit with TASK_RUNNING make sure we enter with it,
         * otherwise we will destroy state.
         */
-       if (WARN(current->state != TASK_RUNNING,
+       if (WARN_ONCE(current->state != TASK_RUNNING,
                        "do not call blocking ops when !TASK_RUNNING; "
                        "state=%lx set at [<%p>] %pS\n",
                        current->state,