Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[muen/linux.git] / kernel / sched / core.c
index 64ceaa5158c514b04595a2e71e19c600772972b7..0002995570db2120c0cf38a93bfbd50b3e478345 100644 (file)
@@ -5293,9 +5293,8 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
 }
 
 #ifdef CONFIG_COMPAT_32BIT_TIME
-COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval,
-                      compat_pid_t, pid,
-                      struct old_timespec32 __user *, interval)
+SYSCALL_DEFINE2(sched_rr_get_interval_time32, pid_t, pid,
+               struct old_timespec32 __user *, interval)
 {
        struct timespec64 t;
        int retval = sched_rr_get_interval(pid, &t);
@@ -6187,6 +6186,34 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
        add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
 }
 EXPORT_SYMBOL(___might_sleep);
+
+void __cant_sleep(const char *file, int line, int preempt_offset)
+{
+       static unsigned long prev_jiffy;
+
+       if (irqs_disabled())
+               return;
+
+       if (!IS_ENABLED(CONFIG_PREEMPT_COUNT))
+               return;
+
+       if (preempt_count() > preempt_offset)
+               return;
+
+       if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
+               return;
+       prev_jiffy = jiffies;
+
+       printk(KERN_ERR "BUG: assuming atomic context at %s:%d\n", file, line);
+       printk(KERN_ERR "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n",
+                       in_atomic(), irqs_disabled(),
+                       current->pid, current->comm);
+
+       debug_show_held_locks(current);
+       dump_stack();
+       add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
+}
+EXPORT_SYMBOL_GPL(__cant_sleep);
 #endif
 
 #ifdef CONFIG_MAGIC_SYSRQ