Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

3.2-rc2-rt3

  • Loading branch information...
commit 75b63651e4cdab0c861abeb4bafd5268da457f86 1 parent cfcfc9e
@fchecconi authored
Showing with 8,411 additions and 1,722 deletions.
  1. +64 −0 Documentation/hwlat_detector.txt
  2. +9 −2 Documentation/sysrq.txt
  3. +186 −0 Documentation/trace/histograms.txt
  4. +9 −0 MAINTAINERS
  5. +1 −0  arch/Kconfig
  6. +1 −1  arch/alpha/mm/fault.c
  7. +2 −1  arch/arm/Kconfig
  8. +3 −14 arch/arm/kernel/early_printk.c
  9. +1 −1  arch/arm/kernel/perf_event.c
  10. +26 −3 arch/arm/kernel/process.c
  11. +3 −0  arch/arm/kernel/signal.c
  12. +2 −0  arch/arm/mach-at91/at91rm9200_time.c
  13. +5 −1 arch/arm/mach-at91/at91sam926x_time.c
  14. +6 −6 arch/arm/mach-exynos/platsmp.c
  15. +5 −5 arch/arm/mach-msm/platsmp.c
  16. +5 −5 arch/arm/mach-omap2/omap-smp.c
  17. +5 −5 arch/arm/mach-tegra/platsmp.c
  18. +5 −5 arch/arm/mach-ux500/platsmp.c
  19. +1 −1  arch/arm/mm/fault.c
  20. +5 −5 arch/arm/plat-versatile/platsmp.c
  21. +1 −3 arch/avr32/kernel/process.c
  22. +1 −1  arch/avr32/mm/fault.c
  23. +0 −2  arch/blackfin/kernel/early_printk.c
  24. +1 −3 arch/blackfin/kernel/process.c
  25. +1 −3 arch/cris/kernel/process.c
  26. +1 −1  arch/cris/mm/fault.c
  27. +1 −3 arch/frv/kernel/process.c
  28. +1 −1  arch/frv/mm/fault.c
  29. +1 −3 arch/h8300/kernel/process.c
  30. +1 −3 arch/ia64/kernel/process.c
  31. +3 −3 arch/ia64/kernel/time.c
  32. +1 −1  arch/ia64/mm/fault.c
  33. +1 −3 arch/m32r/kernel/process.c
  34. +1 −1  arch/m32r/mm/fault.c
  35. +1 −3 arch/m68k/kernel/process_mm.c
  36. +1 −3 arch/m68k/kernel/process_no.c
  37. +1 −1  arch/m68k/mm/fault.c
  38. +4 −22 arch/microblaze/kernel/early_printk.c
  39. +1 −3 arch/microblaze/kernel/process.c
  40. +1 −1  arch/microblaze/mm/fault.c
  41. +1 −1  arch/mips/Kconfig
  42. +3 −2 arch/mips/cavium-octeon/smp.c
  43. +4 −6 arch/mips/kernel/early_printk.c
  44. +1 −3 arch/mips/kernel/process.c
  45. +3 −0  arch/mips/kernel/signal.c
  46. +1 −1  arch/mips/mm/fault.c
  47. +1 −3 arch/mn10300/kernel/process.c
  48. +1 −1  arch/mn10300/mm/fault.c
  49. +1 −3 arch/parisc/kernel/process.c
  50. +1 −1  arch/parisc/mm/fault.c
  51. +4 −2 arch/powerpc/Kconfig
  52. +4 −4 arch/powerpc/kernel/idle.c
  53. +2 −1  arch/powerpc/kernel/irq.c
  54. +2 −0  arch/powerpc/kernel/misc_32.S
  55. +2 −0  arch/powerpc/kernel/misc_64.S
  56. +2 −2 arch/powerpc/kernel/smp.c
  57. +2 −4 arch/powerpc/kernel/udbg.c
  58. +1 −1  arch/powerpc/mm/fault.c
  59. +1 −1  arch/powerpc/platforms/85xx/mpc85xx_cds.c
  60. +2 −6 arch/powerpc/platforms/iseries/setup.c
  61. +2 −2 arch/powerpc/platforms/powermac/smp.c
  62. +2 −1  arch/powerpc/platforms/wsp/opb_pic.c
  63. +3 −2 arch/powerpc/sysdev/xics/xics-common.c
  64. +1 −3 arch/s390/kernel/process.c
  65. +4 −2 arch/s390/mm/fault.c
  66. +1 −3 arch/score/kernel/process.c
  67. +1 −1  arch/score/mm/fault.c
  68. +1 −3 arch/sh/kernel/idle.c
  69. +2 −0  arch/sh/kernel/irq.c
  70. +0 −2  arch/sh/kernel/sh_bios.c
  71. +1 −1  arch/sh/mm/fault_32.c
  72. +2 −0  arch/sparc/kernel/irq_64.c
  73. +2 −6 arch/sparc/kernel/process_32.c
  74. +4 −6 arch/sparc/kernel/process_64.c
  75. +2 −2 arch/sparc/kernel/prom_common.c
  76. +1 −0  arch/sparc/kernel/setup_32.c
  77. +7 −1 arch/sparc/kernel/setup_64.c
  78. +2 −2 arch/sparc/mm/fault_32.c
  79. +1 −1  arch/sparc/mm/fault_64.c
  80. +4 −22 arch/tile/kernel/early_printk.c
  81. +1 −3 arch/tile/kernel/process.c
  82. +1 −1  arch/tile/mm/fault.c
  83. +5 −3 arch/um/kernel/early_printk.c
  84. +1 −1  arch/um/kernel/trap.c
  85. +4 −8 arch/unicore32/kernel/early_printk.c
  86. +2 −2 arch/x86/Kconfig
  87. +13 −11 arch/x86/crypto/aesni-intel_glue.c
  88. +2 −2 arch/x86/include/asm/acpi.h
  89. +15 −6 arch/x86/include/asm/page_64_types.h
  90. +9 −1 arch/x86/include/asm/stackprotector.h
  91. +1 −1  arch/x86/include/asm/vgtod.h
  92. +3 −3 arch/x86/kernel/apic/apic.c
  93. +3 −2 arch/x86/kernel/apic/io_apic.c
  94. +2 −0  arch/x86/kernel/cpu/common.c
  95. +23 −26 arch/x86/kernel/cpu/mcheck/mce.c
  96. +1 −1  arch/x86/kernel/cpu/mcheck/therm_throt.c
  97. +1 −1  arch/x86/kernel/cpu/mcheck/threshold.c
  98. +4 −0 arch/x86/kernel/dumpstack_64.c
  99. +2 −19 arch/x86/kernel/early_printk.c
  100. +8 −0 arch/x86/kernel/entry_32.S
  101. +2 −0  arch/x86/kernel/entry_64.S
  102. +27 −0 arch/x86/kernel/hpet.c
  103. +3 −3 arch/x86/kernel/irq.c
  104. +2 −0  arch/x86/kernel/irq_32.c
  105. +2 −1  arch/x86/kernel/irq_64.c
  106. +2 −0  arch/x86/kernel/irq_work.c
  107. +0 −1  arch/x86/kernel/kprobes.c
  108. +37 −3 arch/x86/kernel/process_32.c
  109. +1 −3 arch/x86/kernel/process_64.c
  110. +5 −5 arch/x86/kernel/vsyscall_64.c
  111. +7 −0 arch/x86/kvm/x86.c
  112. +1 −1  arch/x86/mm/fault.c
  113. +1 −1  arch/x86/mm/highmem_32.c
  114. +1 −3 arch/xtensa/kernel/process.c
  115. +1 −1  arch/xtensa/mm/fault.c
  116. +9 −13 block/blk-core.c
  117. +6 −6 drivers/ata/libata-sff.c
  118. +8 −7 drivers/char/random.c
  119. +26 −18 drivers/clocksource/tcb_clksrc.c
  120. +0 −9 drivers/gpu/drm/drm_irq.c
  121. +2 −2 drivers/ide/alim15x3.c
  122. +2 −2 drivers/ide/hpt366.c
  123. +4 −4 drivers/ide/ide-io-std.c
  124. +1 −1  drivers/ide/ide-io.c
  125. +2 −2 drivers/ide/ide-iops.c
  126. +2 −2 drivers/ide/ide-probe.c
  127. +3 −3 drivers/ide/ide-taskfile.c
  128. +2 −2 drivers/infiniband/ulp/ipoib/ipoib_multicast.c
  129. +4 −4 drivers/input/gameport/gameport.c
  130. +2 −2 drivers/md/dm.c
  131. +5 −2 drivers/md/raid5.c
  132. +1 −0  drivers/md/raid5.h
  133. +39 −2 drivers/misc/Kconfig
  134. +1 −0  drivers/misc/Makefile
  135. +1,212 −0 drivers/misc/hwlat_detector.c
  136. +1 −0  drivers/net/Kconfig
  137. +4 −4 drivers/net/ethernet/3com/3c59x.c
  138. +2 −5 drivers/net/ethernet/atheros/atl1c/atl1c_main.c
  139. +1 −2  drivers/net/ethernet/atheros/atl1e/atl1e_main.c
  140. +5 −0 drivers/net/ethernet/cadence/at91_ether.c
  141. +1 −2  drivers/net/ethernet/chelsio/cxgb/sge.c
  142. +1 −0  drivers/net/ethernet/dec/tulip/tulip_core.c
  143. +4 −4 drivers/net/ethernet/freescale/gianfar.c
  144. +1 −1  drivers/net/ethernet/ibm/ehea/ehea_main.c
  145. +1 −6 drivers/net/ethernet/neterion/s2io.c
  146. +3 −4 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
  147. +1 −1  drivers/net/ethernet/realtek/8139too.c
  148. +2 −7 drivers/net/ethernet/tehuti/tehuti.c
  149. +1 −5 drivers/net/rionet.c
  150. +118 −57 drivers/of/base.c
  151. +9 −8 drivers/scsi/fcoe/fcoe.c
  152. +2 −2 drivers/scsi/fcoe/fcoe_ctlr.c
  153. +2 −2 drivers/scsi/libfc/fc_exch.c
  154. +11 −9 drivers/tty/serial/8250.c
  155. +1 −1  drivers/tty/serial/cpm_uart/cpm_uart_core.c
  156. +3 −5 drivers/tty/serial/omap-serial.c
  157. +23 −0 drivers/tty/sysrq.c
  158. +4 −0 drivers/tty/tty_buffer.c
  159. +2 −2 drivers/tty/tty_ldisc.c
  160. +2 −2 drivers/usb/core/hcd.c
  161. +1 −1  drivers/usb/gadget/ci13xxx_udc.c
  162. +7 −3 drivers/usb/host/ohci-hcd.c
  163. +7 −14 fs/buffer.c
  164. +2 −2 fs/eventpoll.c
  165. +2 −0  fs/exec.c
  166. +3 −3 fs/file.c
  167. +7 −3 fs/namespace.c
  168. +5 −9 fs/ntfs/aops.c
  169. +18 −0 include/asm-generic/bug.h
  170. +4 −4 include/asm-generic/cmpxchg-local.h
  171. +44 −0 include/linux/buffer_head.h
  172. +1 −0  include/linux/console.h
  173. +8 −2 include/linux/cpu.h
  174. +2 −1  include/linux/ftrace_event.h
  175. +13 −3 include/linux/hardirq.h
  176. +13 −0 include/linux/hrtimer.h
  177. +1 −1  include/linux/idr.h
  178. +10 −1 include/linux/init_task.h
  179. +21 −3 include/linux/interrupt.h
  180. +26 −3 include/linux/irqflags.h
  181. +24 −0 include/linux/jbd_common.h
  182. +1 −1  include/linux/jump_label.h
  183. +2 −0  include/linux/kdb.h
  184. +1 −1  include/linux/kernel.h
  185. +100 −0 include/linux/lglock.h
  186. +11 −0 include/linux/list.h
  187. +230 −0 include/linux/locallock.h
  188. +39 −7 include/linux/mm.h
  189. +9 −1 include/linux/mm_types.h
  190. +14 −7 include/linux/mutex.h
  191. +84 −0 include/linux/mutex_rt.h
  192. +1 −0  include/linux/netdevice.h
  193. +1 −1  include/linux/of.h
  194. +28 −0 include/linux/page_cgroup.h
  195. +25 −0 include/linux/percpu.h
  196. +1 −0  include/linux/pid.h
  197. +30 −2 include/linux/preempt.h
  198. +7 −1 include/linux/printk.h
  199. +7 −1 include/linux/radix-tree.h
  200. +26 −0 include/linux/rcupdate.h
  201. +16 −2 include/linux/rcutree.h
  202. +30 −8 include/linux/rtmutex.h
  203. +123 −0 include/linux/rwlock_rt.h
  204. +6 −1 include/linux/rwlock_types.h
  205. +33 −0 include/linux/rwlock_types_rt.h
  206. +6 −0 include/linux/rwsem.h
  207. +105 −0 include/linux/rwsem_rt.h
  208. +99 −3 include/linux/sched.h
  209. +146 −104 include/linux/seqlock.h
  210. +1 −0  include/linux/signal.h
  211. +7 −0 include/linux/skbuff.h
  212. +3 −1 include/linux/smp.h
  213. +11 −1 include/linux/spinlock.h
  214. +3 −1 include/linux/spinlock_api_smp.h
  215. +166 −0 include/linux/spinlock_rt.h
  216. +7 −72 include/linux/spinlock_types.h
  217. +33 −0 include/linux/spinlock_types_nort.h
  218. +56 −0 include/linux/spinlock_types_raw.h
  219. +49 −0 include/linux/spinlock_types_rt.h
  220. +1 −0  include/linux/sysctl.h
  221. +5 −0 include/linux/sysrq.h
  222. +1 −1  include/linux/timer.h
  223. +20 −21 include/linux/uaccess.h
  224. +4 −0 include/linux/vmstat.h
  225. +3 −2 include/linux/workqueue.h
  226. +1 −0  include/net/netns/ipv4.h
  227. +69 −0 include/trace/events/hist.h
  228. +30 −0 include/trace/events/latency_hist.h
  229. +2 −0  init/Kconfig
  230. +1 −1  init/Makefile
  231. +3 −4 init/main.c
  232. +11 −2 ipc/mqueue.c
  233. +16 −0 ipc/msg.c
  234. +10 −0 ipc/sem.c
  235. +1 −1  kernel/Kconfig.locks
  236. +24 −2 kernel/Kconfig.preempt
  237. +7 −2 kernel/Makefile
  238. +122 −1 kernel/cpu.c
  239. +1 −1  kernel/cred.c
  240. +2 −4 kernel/debug/kdb/kdb_io.c
  241. +1 −1  kernel/exit.c
  242. +32 −1 kernel/fork.c
  243. +63 −17 kernel/futex.c
  244. +224 −23 kernel/hrtimer.c
  245. +3 −0  kernel/irq/handle.c
  246. +2 −0  kernel/irq/manage.c
  247. +10 −0 kernel/irq/spurious.c
  248. +2 −0  kernel/irq_work.c
  249. +1 −0  kernel/itimer.c
  250. +12 −0 kernel/ksysfs.c
  251. +2 −0  kernel/lockdep.c
  252. +1 −3 kernel/mutex.c
  253. +2 −0  kernel/panic.c
  254. +191 −6 kernel/posix-cpu-timers.c
  255. +36 −1 kernel/posix-timers.c
  256. +7 −0 kernel/power/hibernate.c
  257. +4 −0 kernel/power/suspend.c
  258. +86 −12 kernel/printk.c
  259. +2 −0  kernel/rcupdate.c
  260. +2 −0  kernel/rcutiny.c
  261. +16 −1 kernel/rcutree.c
  262. +3 −1 kernel/rcutree.h
  263. +10 −8 kernel/rcutree_plugin.h
  264. +5 −9 kernel/relay.c
  265. +4 −4 kernel/res_counter.c
  266. +442 −0 kernel/rt.c
  267. +414 −27 kernel/rtmutex.c
  268. +11 −0 kernel/rtmutex_common.h
  269. +269 −69 kernel/sched.c
  270. +7 −0 kernel/sched_debug.c
  271. +18 −0 kernel/sched_fair.c
  272. +5 −0 kernel/sched_features.h
  273. +29 −7 kernel/sched_rt.c
  274. +85 −15 kernel/signal.c
  275. +312 −55 kernel/softirq.c
  276. +7 −0 kernel/spinlock.c
  277. +57 −22 kernel/stop_machine.c
  278. +8 −8 kernel/time/ntp.c
  279. +2 −2 kernel/time/tick-common.c
  280. +1 −1  kernel/time/tick-internal.h
  281. +6 −11 kernel/time/tick-sched.c
  282. +15 −16 kernel/time/timekeeping.c
  283. +98 −18 kernel/timer.c
  284. +104 −0 kernel/trace/Kconfig
  285. +4 −0 kernel/trace/Makefile
  286. +1,170 −0 kernel/trace/latency_hist.c
  287. +81 −70 kernel/trace/ring_buffer.c
  288. +30 −5 kernel/trace/trace.c
  289. +0 −1  kernel/trace/trace.h
  290. +2 −1  kernel/trace/trace_events.c
  291. +11 −0 kernel/trace/trace_irqsoff.c
  292. +5 −0 kernel/trace/trace_output.c
  293. +2 −2 kernel/user.c
  294. +14 −2 kernel/watchdog.c
  295. +195 −442 kernel/workqueue.c
  296. +2 −3 kernel/workqueue_sched.h
  297. +23 −1 lib/Kconfig.debug
  298. +3 −0  lib/Makefile
  299. +5 −2 lib/debugobjects.c
  300. +4 −1 lib/radix-tree.c
Sorry, we could not display the entire diff because too many files (323) changed.
View
64 Documentation/hwlat_detector.txt
@@ -0,0 +1,64 @@
+Introduction:
+-------------
+
+The module hwlat_detector is a special purpose kernel module that is used to
+detect large system latencies induced by the behavior of certain underlying
+hardware or firmware, independent of Linux itself. The code was developed
+originally to detect SMIs (System Management Interrupts) on x86 systems,
+however there is nothing x86 specific about this patchset. It was
+originally written for use by the "RT" patch since the Real Time
+kernel is highly latency sensitive.
+
+SMIs are usually not serviced by the Linux kernel, which typically does not
+even know that they are occuring. SMIs are instead are set up by BIOS code
+and are serviced by BIOS code, usually for "critical" events such as
+management of thermal sensors and fans. Sometimes though, SMIs are used for
+other tasks and those tasks can spend an inordinate amount of time in the
+handler (sometimes measured in milliseconds). Obviously this is a problem if
+you are trying to keep event service latencies down in the microsecond range.
+
+The hardware latency detector works by hogging all of the cpus for configurable
+amounts of time (by calling stop_machine()), polling the CPU Time Stamp Counter
+for some period, then looking for gaps in the TSC data. Any gap indicates a
+time when the polling was interrupted and since the machine is stopped and
+interrupts turned off the only thing that could do that would be an SMI.
+
+Note that the SMI detector should *NEVER* be used in a production environment.
+It is intended to be run manually to determine if the hardware platform has a
+problem with long system firmware service routines.
+
+Usage:
+------
+
+Loading the module hwlat_detector passing the parameter "enabled=1" (or by
+setting the "enable" entry in "hwlat_detector" debugfs toggled on) is the only
+step required to start the hwlat_detector. It is possible to redefine the
+threshold in microseconds (us) above which latency spikes will be taken
+into account (parameter "threshold=").
+
+Example:
+
+ # modprobe hwlat_detector enabled=1 threshold=100
+
+After the module is loaded, it creates a directory named "hwlat_detector" under
+the debugfs mountpoint, "/debug/hwlat_detector" for this text. It is necessary
+to have debugfs mounted, which might be on /sys/debug on your system.
+
+The /debug/hwlat_detector interface contains the following files:
+
+count - number of latency spikes observed since last reset
+enable - a global enable/disable toggle (0/1), resets count
+max - maximum hardware latency actually observed (usecs)
+sample - a pipe from which to read current raw sample data
+ in the format <timestamp> <latency observed usecs>
+ (can be opened O_NONBLOCK for a single sample)
+threshold - minimum latency value to be considered (usecs)
+width - time period to sample with CPUs held (usecs)
+ must be less than the total window size (enforced)
+window - total period of sampling, width being inside (usecs)
+
+By default we will set width to 500,000 and window to 1,000,000, meaning that
+we will sample every 1,000,000 usecs (1s) for 500,000 usecs (0.5s). If we
+observe any latencies that exceed the threshold (initially 100 usecs),
+then we write to a global sample ring buffer of 8K samples, which is
+consumed by reading from the "sample" (pipe) debugfs file interface.
View
11 Documentation/sysrq.txt
@@ -57,10 +57,17 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
On other - If you know of the key combos for other architectures, please
let me know so I can add them to this section.
-On all - write a character to /proc/sysrq-trigger. e.g.:
-
+On all - write a character to /proc/sysrq-trigger, e.g.:
echo t > /proc/sysrq-trigger
+On all - Enable network SysRq by writing a cookie to icmp_echo_sysrq, e.g.
+ echo 0x01020304 >/proc/sys/net/ipv4/icmp_echo_sysrq
+ Send an ICMP echo request with this pattern plus the particular
+ SysRq command key. Example:
+ # ping -c1 -s57 -p0102030468
+ will trigger the SysRq-H (help) command.
+
+
* What are the 'command' keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'b' - Will immediately reboot the system without syncing or unmounting
View
186 Documentation/trace/histograms.txt
@@ -0,0 +1,186 @@
+ Using the Linux Kernel Latency Histograms
+
+
+This document gives a short explanation how to enable, configure and use
+latency histograms. Latency histograms are primarily relevant in the
+context of real-time enabled kernels (CONFIG_PREEMPT/CONFIG_PREEMPT_RT)
+and are used in the quality management of the Linux real-time
+capabilities.
+
+
+* Purpose of latency histograms
+
+A latency histogram continuously accumulates the frequencies of latency
+data. There are two types of histograms
+- potential sources of latencies
+- effective latencies
+
+
+* Potential sources of latencies
+
+Potential sources of latencies are code segments where interrupts,
+preemption or both are disabled (aka critical sections). To create
+histograms of potential sources of latency, the kernel stores the time
+stamp at the start of a critical section, determines the time elapsed
+when the end of the section is reached, and increments the frequency
+counter of that latency value - irrespective of whether any concurrently
+running process is affected by latency or not.
+- Configuration items (in the Kernel hacking/Tracers submenu)
+ CONFIG_INTERRUPT_OFF_LATENCY
+ CONFIG_PREEMPT_OFF_LATENCY
+
+
+* Effective latencies
+
+Effective latencies are actually occuring during wakeup of a process. To
+determine effective latencies, the kernel stores the time stamp when a
+process is scheduled to be woken up, and determines the duration of the
+wakeup time shortly before control is passed over to this process. Note
+that the apparent latency in user space may be somewhat longer, since the
+process may be interrupted after control is passed over to it but before
+the execution in user space takes place. Simply measuring the interval
+between enqueuing and wakeup may also not appropriate in cases when a
+process is scheduled as a result of a timer expiration. The timer may have
+missed its deadline, e.g. due to disabled interrupts, but this latency
+would not be registered. Therefore, the offsets of missed timers are
+recorded in a separate histogram. If both wakeup latency and missed timer
+offsets are configured and enabled, a third histogram may be enabled that
+records the overall latency as a sum of the timer latency, if any, and the
+wakeup latency. This histogram is called "timerandwakeup".
+- Configuration items (in the Kernel hacking/Tracers submenu)
+ CONFIG_WAKEUP_LATENCY
+ CONFIG_MISSED_TIMER_OFSETS
+
+
+* Usage
+
+The interface to the administration of the latency histograms is located
+in the debugfs file system. To mount it, either enter
+
+mount -t sysfs nodev /sys
+mount -t debugfs nodev /sys/kernel/debug
+
+from shell command line level, or add
+
+nodev /sys sysfs defaults 0 0
+nodev /sys/kernel/debug debugfs defaults 0 0
+
+to the file /etc/fstab. All latency histogram related files are then
+available in the directory /sys/kernel/debug/tracing/latency_hist. A
+particular histogram type is enabled by writing non-zero to the related
+variable in the /sys/kernel/debug/tracing/latency_hist/enable directory.
+Select "preemptirqsoff" for the histograms of potential sources of
+latencies and "wakeup" for histograms of effective latencies etc. The
+histogram data - one per CPU - are available in the files
+
+/sys/kernel/debug/tracing/latency_hist/preemptoff/CPUx
+/sys/kernel/debug/tracing/latency_hist/irqsoff/CPUx
+/sys/kernel/debug/tracing/latency_hist/preemptirqsoff/CPUx
+/sys/kernel/debug/tracing/latency_hist/wakeup/CPUx
+/sys/kernel/debug/tracing/latency_hist/wakeup/sharedprio/CPUx
+/sys/kernel/debug/tracing/latency_hist/missed_timer_offsets/CPUx
+/sys/kernel/debug/tracing/latency_hist/timerandwakeup/CPUx
+
+The histograms are reset by writing non-zero to the file "reset" in a
+particular latency directory. To reset all latency data, use
+
+#!/bin/sh
+
+TRACINGDIR=/sys/kernel/debug/tracing
+HISTDIR=$TRACINGDIR/latency_hist
+
+if test -d $HISTDIR
+then
+ cd $HISTDIR
+ for i in `find . | grep /reset$`
+ do
+ echo 1 >$i
+ done
+fi
+
+
+* Data format
+
+Latency data are stored with a resolution of one microsecond. The
+maximum latency is 10,240 microseconds. The data are only valid, if the
+overflow register is empty. Every output line contains the latency in
+microseconds in the first row and the number of samples in the second
+row. To display only lines with a positive latency count, use, for
+example,
+
+grep -v " 0$" /sys/kernel/debug/tracing/latency_hist/preemptoff/CPU0
+
+#Minimum latency: 0 microseconds.
+#Average latency: 0 microseconds.
+#Maximum latency: 25 microseconds.
+#Total samples: 3104770694
+#There are 0 samples greater or equal than 10240 microseconds
+#usecs samples
+ 0 2984486876
+ 1 49843506
+ 2 58219047
+ 3 5348126
+ 4 2187960
+ 5 3388262
+ 6 959289
+ 7 208294
+ 8 40420
+ 9 4485
+ 10 14918
+ 11 18340
+ 12 25052
+ 13 19455
+ 14 5602
+ 15 969
+ 16 47
+ 17 18
+ 18 14
+ 19 1
+ 20 3
+ 21 2
+ 22 5
+ 23 2
+ 25 1
+
+
+* Wakeup latency of a selected process
+
+To only collect wakeup latency data of a particular process, write the
+PID of the requested process to
+
+/sys/kernel/debug/tracing/latency_hist/wakeup/pid
+
+PIDs are not considered, if this variable is set to 0.
+
+
+* Details of the process with the highest wakeup latency so far
+
+Selected data of the process that suffered from the highest wakeup
+latency that occurred in a particular CPU are available in the file
+
+/sys/kernel/debug/tracing/latency_hist/wakeup/max_latency-CPUx.
+
+In addition, other relevant system data at the time when the
+latency occurred are given.
+
+The format of the data is (all in one line):
+<PID> <Priority> <Latency> (<Timeroffset>) <Command> \
+<- <PID> <Priority> <Command> <Timestamp>
+
+The value of <Timeroffset> is only relevant in the combined timer
+and wakeup latency recording. In the wakeup recording, it is
+always 0, in the missed_timer_offsets recording, it is the same
+as <Latency>.
+
+When retrospectively searching for the origin of a latency and
+tracing was not enabled, it may be helpful to know the name and
+some basic data of the task that (finally) was switching to the
+late real-tlme task. In addition to the victim's data, also the
+data of the possible culprit are therefore displayed after the
+"<-" symbol.
+
+Finally, the timestamp of the time when the latency occurred
+in <seconds>.<microseconds> after the most recent system boot
+is provided.
+
+These data are also reset when the wakeup histogram is reset.
View
9 MAINTAINERS
@@ -3008,6 +3008,15 @@ L: linuxppc-dev@lists.ozlabs.org
S: Odd Fixes
F: drivers/tty/hvc/
+HARDWARE LATENCY DETECTOR
+P: Jon Masters
+M: jcm@jonmasters.org
+W: http://www.kernel.org/pub/linux/kernel/people/jcm/hwlat_detector/
+S: Supported
+L: linux-kernel@vger.kernel.org
+F: Documentation/hwlat_detector.txt
+F: drivers/misc/hwlat_detector.c
+
HARDWARE MONITORING
M: Jean Delvare <khali@linux-fr.org>
M: Guenter Roeck <guenter.roeck@ericsson.com>
View
1  arch/Kconfig
@@ -6,6 +6,7 @@ config OPROFILE
tristate "OProfile system profiling"
depends on PROFILING
depends on HAVE_OPROFILE
+ depends on !PREEMPT_RT_FULL
select RING_BUFFER
select RING_BUFFER_ALLOW_SWAP
help
View
2  arch/alpha/mm/fault.c
@@ -107,7 +107,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
/* If we're in an interrupt context, or have no user context,
we must not take the fault. */
- if (!mm || in_atomic())
+ if (!mm || pagefault_disabled())
goto no_context;
#ifdef CONFIG_ALPHA_LARGE_VMALLOC
View
3  arch/arm/Kconfig
@@ -29,6 +29,7 @@ config ARM
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
select GENERIC_IRQ_SHOW
+ select IRQ_FORCED_THREADING
select CPU_PM if (SUSPEND || CPU_IDLE)
help
The ARM series is a line of low-power-consumption RISC chip designs
@@ -1654,7 +1655,7 @@ config HAVE_ARCH_PFN_VALID
config HIGHMEM
bool "High Memory Support"
- depends on MMU
+ depends on MMU && !PREEMPT_RT_FULL
help
The address space of ARM processors is only 4 Gigabytes large
and it has to accommodate user address space, kernel address
View
17 arch/arm/kernel/early_printk.c
@@ -29,28 +29,17 @@ static void early_console_write(struct console *con, const char *s, unsigned n)
early_write(s, n);
}
-static struct console early_console = {
+static struct console early_console_dev = {
.name = "earlycon",
.write = early_console_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1,
};
-asmlinkage void early_printk(const char *fmt, ...)
-{
- char buf[512];
- int n;
- va_list ap;
-
- va_start(ap, fmt);
- n = vscnprintf(buf, sizeof(buf), fmt, ap);
- early_write(buf, n);
- va_end(ap);
-}
-
static int __init setup_early_printk(char *buf)
{
- register_console(&early_console);
+ early_console = &early_console_dev;
+ register_console(&early_console_dev);
return 0;
}
View
2  arch/arm/kernel/perf_event.c
@@ -432,7 +432,7 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
}
err = request_irq(irq, handle_irq,
- IRQF_DISABLED | IRQF_NOBALANCING,
+ IRQF_NOBALANCING | IRQF_NO_THREAD,
"arm-pmu", armpmu);
if (err) {
pr_err("unable to request IRQ%d for ARM PMU counters\n",
View
29 arch/arm/kernel/process.c
@@ -211,9 +211,7 @@ void cpu_idle(void)
}
leds_event(led_idle_end);
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
@@ -488,6 +486,31 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
}
#ifdef CONFIG_MMU
+
+/*
+ * CONFIG_SPLIT_PTLOCK_CPUS results in a page->ptl lock. If the lock is not
+ * initialized by pgtable_page_ctor() then a coredump of the vector page will
+ * fail.
+ */
+static int __init vectors_user_mapping_init_page(void)
+{
+ struct page *page;
+ unsigned long addr = 0xffff0000;
+ pgd_t *pgd;
+ pud_t *pud;
+ pmd_t *pmd;
+
+ pgd = pgd_offset_k(addr);
+ pud = pud_offset(pgd, addr);
+ pmd = pmd_offset(pud, addr);
+ page = pmd_page(*(pmd));
+
+ pgtable_page_ctor(page);
+
+ return 0;
+}
+late_initcall(vectors_user_mapping_init_page);
+
/*
* The vectors page is always readable from user space for the
* atomic helpers and the signal restart code. Let's declare a mapping
View
3  arch/arm/kernel/signal.c
@@ -673,6 +673,9 @@ static void do_signal(struct pt_regs *regs, int syscall)
if (!user_mode(regs))
return;
+ local_irq_enable();
+ preempt_check_resched();
+
/*
* If we were from a system call, check for system call restarting...
*/
View
2  arch/arm/mach-at91/at91rm9200_time.c
@@ -114,6 +114,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
last_crtr = read_CRTR();
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
+ setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
/* PIT for periodic irqs; fixed rate of 1/HZ */
irqmask = AT91_ST_PITS;
at91_sys_write(AT91_ST_PIMR, LATCH);
@@ -127,6 +128,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
break;
case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED:
+ remove_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
case CLOCK_EVT_MODE_RESUME:
irqmask = 0;
break;
View
6 arch/arm/mach-at91/at91sam926x_time.c
@@ -54,7 +54,7 @@ static struct clocksource pit_clk = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-
+static struct irqaction at91sam926x_pit_irq;
/*
* Clockevent device: interrupts every 1/HZ (== pit_cycles * MCK/16)
*/
@@ -63,6 +63,9 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
{
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
+ /* Set up irq handler */
+ setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
+
/* update clocksource counter */
pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
@@ -75,6 +78,7 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
case CLOCK_EVT_MODE_UNUSED:
/* disable irq, leaving the clocksource active */
at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+ remove_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
break;
case CLOCK_EVT_MODE_RESUME:
break;
View
12 arch/arm/mach-exynos/platsmp.c
@@ -63,7 +63,7 @@ static void __iomem *scu_base_addr(void)
return (void __iomem *)(S5P_VA_SCU);
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
static void __cpuinit exynos4_gic_secondary_init(void)
{
@@ -108,8 +108,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -120,7 +120,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* The secondary processor is waiting to be released from
@@ -149,7 +149,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
if (timeout == 0) {
printk(KERN_ERR "cpu1 power enable failed");
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return -ETIMEDOUT;
}
}
@@ -177,7 +177,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return pen_release != -1 ? -ENOSYS : 0;
}
View
10 arch/arm/mach-msm/platsmp.c
@@ -39,7 +39,7 @@ extern void msm_secondary_startup(void);
*/
volatile int pen_release = -1;
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
static inline int get_core_count(void)
{
@@ -69,8 +69,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
static __cpuinit void prepare_cold_cpu(unsigned int cpu)
@@ -107,7 +107,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* The secondary processor is waiting to be released from
@@ -141,7 +141,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return pen_release != -1 ? -ENOSYS : 0;
}
View
10 arch/arm/mach-omap2/omap-smp.c
@@ -29,7 +29,7 @@
/* SCU base address */
static void __iomem *scu_base;
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
{
@@ -43,8 +43,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -53,7 +53,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* Update the AuxCoreBoot0 with boot state for secondary core.
@@ -70,7 +70,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return 0;
}
View
10 arch/arm/mach-tegra/platsmp.c
@@ -28,7 +28,7 @@
extern void tegra_secondary_startup(void);
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE);
#define EVP_CPU_RESET_VECTOR \
@@ -50,8 +50,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -65,7 +65,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/* set the reset vector to point to the secondary_startup routine */
@@ -101,7 +101,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return 0;
}
View
10 arch/arm/mach-ux500/platsmp.c
@@ -57,7 +57,7 @@ static void __iomem *scu_base_addr(void)
return NULL;
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
{
@@ -77,8 +77,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -89,7 +89,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* The secondary processor is waiting to be released from
@@ -110,7 +110,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return pen_release != -1 ? -ENOSYS : 0;
}
View
2  arch/arm/mm/fault.c
@@ -294,7 +294,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
/*
View
10 arch/arm/plat-versatile/platsmp.c
@@ -37,7 +37,7 @@ static void __cpuinit write_pen_release(int val)
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
{
@@ -57,8 +57,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -69,7 +69,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* This is really belt and braces; we hold unintended secondary
@@ -99,7 +99,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return pen_release != -1 ? -ENOSYS : 0;
}
View
4 arch/avr32/kernel/process.c
@@ -38,9 +38,7 @@ void cpu_idle(void)
while (!need_resched())
cpu_idle_sleep();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/avr32/mm/fault.c
@@ -81,7 +81,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs)
* If we're in an interrupt or have no user context, we must
* not take the fault...
*/
- if (in_atomic() || !mm || regs->sr & SYSREG_BIT(GM))
+ if (!mm || regs->sr & SYSREG_BIT(GM) || pagefault_disabled())
goto no_context;
local_irq_enable();
View
2  arch/blackfin/kernel/early_printk.c
@@ -25,8 +25,6 @@ extern struct console *bfin_earlyserial_init(unsigned int port,
extern struct console *bfin_jc_early_init(void);
#endif
-static struct console *early_console;
-
/* Default console */
#define DEFAULT_PORT 0
#define DEFAULT_CFLAG CS8|B57600
View
4 arch/blackfin/kernel/process.c
@@ -92,9 +92,7 @@ void cpu_idle(void)
while (!need_resched())
idle();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
4 arch/cris/kernel/process.c
@@ -115,9 +115,7 @@ void cpu_idle (void)
idle = default_idle;
idle();
}
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/cris/mm/fault.c
@@ -111,7 +111,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
* user context, we must not take the fault.
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
4 arch/frv/kernel/process.c
@@ -92,9 +92,7 @@ void cpu_idle(void)
idle();
}
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/frv/mm/fault.c
@@ -79,7 +79,7 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
4 arch/h8300/kernel/process.c
@@ -81,9 +81,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
idle();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
4 arch/ia64/kernel/process.c
@@ -330,9 +330,7 @@ cpu_idle (void)
normal_xtp();
#endif
}
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
check_pgt_cache();
if (cpu_is_offline(cpu))
play_dead();
View
6 arch/ia64/kernel/time.c
@@ -36,7 +36,7 @@
static cycle_t itc_get_cycles(struct clocksource *cs);
struct fsyscall_gtod_data_t fsyscall_gtod_data = {
- .lock = __SEQLOCK_UNLOCKED(fsyscall_gtod_data.lock),
+ .lock = __RAW_SEQLOCK_UNLOCKED(fsyscall_gtod_data.lock),
};
struct itc_jitter_data_t itc_jitter_data;
@@ -462,7 +462,7 @@ void update_vsyscall(struct timespec *wall, struct timespec *wtm,
{
unsigned long flags;
- write_seqlock_irqsave(&fsyscall_gtod_data.lock, flags);
+ raw_write_seqlock_irqsave(&fsyscall_gtod_data.lock, flags);
/* copy fsyscall clock data */
fsyscall_gtod_data.clk_mask = c->mask;
@@ -485,6 +485,6 @@ void update_vsyscall(struct timespec *wall, struct timespec *wtm,
fsyscall_gtod_data.monotonic_time.tv_sec++;
}
- write_sequnlock_irqrestore(&fsyscall_gtod_data.lock, flags);
+ raw_write_sequnlock_irqrestore(&fsyscall_gtod_data.lock, flags);
}
View
2  arch/ia64/mm/fault.c
@@ -89,7 +89,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
/*
* If we're in an interrupt or have no user context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
#ifdef CONFIG_VIRTUAL_MEM_MAP
View
4 arch/m32r/kernel/process.c
@@ -90,9 +90,7 @@ void cpu_idle (void)
idle();
}
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/m32r/mm/fault.c
@@ -115,7 +115,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
* If we're in an interrupt or have no user context or are running in an
* atomic region then we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto bad_area_nosemaphore;
/* When running in the kernel we expect faults to occur only to
View
4 arch/m68k/kernel/process_mm.c
@@ -94,9 +94,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
idle();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
4 arch/m68k/kernel/process_no.c
@@ -73,9 +73,7 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
while (1) {
idle();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/m68k/mm/fault.c
@@ -85,7 +85,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
26 arch/microblaze/kernel/early_printk.c
@@ -21,7 +21,6 @@
#include <asm/setup.h>
#include <asm/prom.h>
-static u32 early_console_initialized;
static u32 base_addr;
#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
@@ -109,27 +108,11 @@ static struct console early_serial_uart16550_console = {
};
#endif /* CONFIG_SERIAL_8250_CONSOLE */
-static struct console *early_console;
-
-void early_printk(const char *fmt, ...)
-{
- char buf[512];
- int n;
- va_list ap;
-
- if (early_console_initialized) {
- va_start(ap, fmt);
- n = vscnprintf(buf, 512, fmt, ap);
- early_console->write(early_console, buf, n);
- va_end(ap);
- }
-}
-
int __init setup_early_printk(char *opt)
{
int version = 0;
- if (early_console_initialized)
+ if (early_console)
return 1;
base_addr = of_early_console(&version);
@@ -159,7 +142,6 @@ int __init setup_early_printk(char *opt)
}
register_console(early_console);
- early_console_initialized = 1;
return 0;
}
return 1;
@@ -169,7 +151,7 @@ int __init setup_early_printk(char *opt)
* only for early console because of performance degression */
void __init remap_early_printk(void)
{
- if (!early_console_initialized || !early_console)
+ if (!early_console)
return;
printk(KERN_INFO "early_printk_console remaping from 0x%x to ",
base_addr);
@@ -179,9 +161,9 @@ void __init remap_early_printk(void)
void __init disable_early_printk(void)
{
- if (!early_console_initialized || !early_console)
+ if (!early_console)
return;
printk(KERN_WARNING "disabling early console\n");
unregister_console(early_console);
- early_console_initialized = 0;
+ early_console = NULL;
}
View
4 arch/microblaze/kernel/process.c
@@ -108,9 +108,7 @@ void cpu_idle(void)
idle();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
check_pgt_cache();
}
}
View
2  arch/microblaze/mm/fault.c
@@ -107,7 +107,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
if ((error_code & 0x13) == 0x13 || (error_code & 0x11) == 0x11)
is_write = 0;
- if (unlikely(in_atomic() || !mm)) {
+ if (unlikely(!mm || pagefault_disabled())) {
if (kernel_mode(regs))
goto bad_area_nosemaphore;
View
2  arch/mips/Kconfig
@@ -2040,7 +2040,7 @@ config CPU_R4400_WORKAROUNDS
#
config HIGHMEM
bool "High Memory Support"
- depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM
+ depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !PREEMPT_RT_FULL
config CPU_SUPPORTS_HIGHMEM
bool
View
5 arch/mips/cavium-octeon/smp.c
@@ -207,8 +207,9 @@ void octeon_prepare_cpus(unsigned int max_cpus)
* the other bits alone.
*/
cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffff);
- if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_DISABLED,
- "SMP-IPI", mailbox_interrupt)) {
+ if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt,
+ IRQF_PERCPU | IRQF_NO_THREAD, "SMP-IPI",
+ mailbox_interrupt)) {
panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n");
}
}
View
10 arch/mips/kernel/early_printk.c
@@ -25,20 +25,18 @@ early_console_write(struct console *con, const char *s, unsigned n)
}
}
-static struct console early_console __initdata = {
+static struct console early_console_prom = {
.name = "early",
.write = early_console_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1
};
-static int early_console_initialized __initdata;
-
void __init setup_early_printk(void)
{
- if (early_console_initialized)
+ if (early_console)
return;
- early_console_initialized = 1;
+ early_console = &early_console_prom;
- register_console(&early_console);
+ register_console(&early_console_prom);
}
View
4 arch/mips/kernel/process.c
@@ -78,9 +78,7 @@ void __noreturn cpu_idle(void)
play_dead();
#endif
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
3  arch/mips/kernel/signal.c
@@ -604,6 +604,9 @@ static void do_signal(struct pt_regs *regs)
if (!user_mode(regs))
return;
+ local_irq_enable();
+ preempt_check_resched();
+
if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
View
2  arch/mips/mm/fault.c
@@ -88,7 +88,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto bad_area_nosemaphore;
down_read(&mm->mmap_sem);
View
4 arch/mn10300/kernel/process.c
@@ -123,9 +123,7 @@ void cpu_idle(void)
idle();
}
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/mn10300/mm/fault.c
@@ -168,7 +168,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long fault_code,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
4 arch/parisc/kernel/process.c
@@ -71,9 +71,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
barrier();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
check_pgt_cache();
}
}
View
2  arch/parisc/mm/fault.c
@@ -176,7 +176,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
unsigned long acc_type;
int fault;
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
6 arch/powerpc/Kconfig
@@ -69,10 +69,11 @@ config LOCKDEP_SUPPORT
config RWSEM_GENERIC_SPINLOCK
bool
+ default y if PREEMPT_RT_FULL
config RWSEM_XCHGADD_ALGORITHM
bool
- default y
+ default y if !PREEMPT_RT_FULL
config GENERIC_LOCKBREAK
bool
@@ -132,6 +133,7 @@ config PPC
select IRQ_PER_CPU
select GENERIC_IRQ_SHOW
select GENERIC_IRQ_SHOW_LEVEL
+ select IRQ_FORCED_THREADING
select HAVE_RCU_TABLE_FREE if SMP
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_BPF_JIT if (PPC64 && NET)
@@ -274,7 +276,7 @@ menu "Kernel options"
config HIGHMEM
bool "High memory support"
- depends on PPC32
+ depends on PPC32 && !PREEMPT_RT_FULL
source kernel/time/Kconfig
source kernel/Kconfig.hz
View
8 arch/powerpc/kernel/idle.c
@@ -94,11 +94,11 @@ void cpu_idle(void)
HMT_medium();
ppc64_runlatch_on();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- if (cpu_should_die())
+ if (cpu_should_die()) {
+ __preempt_enable_no_resched();
cpu_die();
- schedule();
- preempt_disable();
+ }
+ schedule_preempt_disabled();
}
}
View
3  arch/powerpc/kernel/irq.c
@@ -443,6 +443,7 @@ void irq_ctx_init(void)
}
}
+#ifndef CONFIG_PREEMPT_RT_FULL
static inline void do_softirq_onstack(void)
{
struct thread_info *curtp, *irqtp;
@@ -479,7 +480,7 @@ void do_softirq(void)
local_irq_restore(flags);
}
-
+#endif
/*
* IRQ controller and virtual interrupts
View
2  arch/powerpc/kernel/misc_32.S
@@ -36,6 +36,7 @@
.text
+#ifndef CONFIG_PREEMPT_RT_FULL
_GLOBAL(call_do_softirq)
mflr r0
stw r0,4(r1)
@@ -46,6 +47,7 @@ _GLOBAL(call_do_softirq)
lwz r0,4(r1)
mtlr r0
blr
+#endif
_GLOBAL(call_handle_irq)
mflr r0
View
2  arch/powerpc/kernel/misc_64.S
@@ -29,6 +29,7 @@
.text
+#ifndef CONFIG_PREEMPT_RT_FULL
_GLOBAL(call_do_softirq)
mflr r0
std r0,16(r1)
@@ -39,6 +40,7 @@ _GLOBAL(call_do_softirq)
ld r0,16(r1)
mtlr r0
blr
+#endif
_GLOBAL(call_handle_irq)
ld r8,0(r6)
View
4 arch/powerpc/kernel/smp.c
@@ -187,8 +187,8 @@ int smp_request_message_ipi(int virq, int msg)
return 1;
}
#endif
- err = request_irq(virq, smp_ipi_action[msg], IRQF_PERCPU,
- smp_ipi_name[msg], 0);
+ err = request_irq(virq, smp_ipi_action[msg],
+ IRQF_PERCPU | IRQF_NO_THREAD, smp_ipi_name[msg], 0);
WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n",
virq, smp_ipi_name[msg], err);
View
6 arch/powerpc/kernel/udbg.c
@@ -182,15 +182,13 @@ static struct console udbg_console = {
.index = 0,
};
-static int early_console_initialized;
-
/*
* Called by setup_system after ppc_md->probe and ppc_md->early_init.
* Call it again after setting udbg_putc in ppc_md->setup_arch.
*/
void __init register_early_udbg_console(void)
{
- if (early_console_initialized)
+ if (early_console)
return;
if (!udbg_putc)
@@ -200,7 +198,7 @@ void __init register_early_udbg_console(void)
printk(KERN_INFO "early console immortal !\n");
udbg_console.flags &= ~CON_BOOT;
}
- early_console_initialized = 1;
+ early_console = &udbg_console;
register_console(&udbg_console);
}
View
2  arch/powerpc/mm/fault.c
@@ -162,7 +162,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
}
#endif
- if (in_atomic() || mm == NULL) {
+ if (!mm || pagefault_disabled()) {
if (!user_mode(regs))
return SIGSEGV;
/* in_atomic() in user mode is really bad,
View
2  arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -177,7 +177,7 @@ static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
static struct irqaction mpc85xxcds_8259_irqaction = {
.handler = mpc85xx_8259_cascade_action,
- .flags = IRQF_SHARED,
+ .flags = IRQF_SHARED | IRQF_NO_THREAD,
.name = "8259 cascade",
};
#endif /* PPC_I8259 */
View
8 arch/powerpc/platforms/iseries/setup.c
@@ -582,9 +582,7 @@ static void iseries_shared_idle(void)
if (hvlpevent_is_pending())
process_iSeries_events();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
@@ -611,9 +609,7 @@ static void iseries_dedicated_idle(void)
ppc64_runlatch_on();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
4 arch/powerpc/platforms/powermac/smp.c
@@ -200,7 +200,7 @@ static int psurge_secondary_ipi_init(void)
if (psurge_secondary_virq)
rc = request_irq(psurge_secondary_virq, psurge_ipi_intr,
- IRQF_PERCPU, "IPI", NULL);
+ IRQF_NO_THREAD | IRQF_PERCPU, "IPI", NULL);
if (rc)
pr_err("Failed to setup secondary cpu IPI\n");
@@ -408,7 +408,7 @@ static int __init smp_psurge_kick_cpu(int nr)
static struct irqaction psurge_irqaction = {
.handler = psurge_ipi_intr,
- .flags = IRQF_PERCPU,
+ .flags = IRQF_PERCPU | IRQF_NO_THREAD,
.name = "primary IPI",
};
View
3  arch/powerpc/platforms/wsp/opb_pic.c
@@ -320,7 +320,8 @@ void __init opb_pic_init(void)
}
/* Attach opb interrupt handler to new virtual IRQ */
- rc = request_irq(virq, opb_irq_handler, 0, "OPB LS Cascade", opb);
+ rc = request_irq(virq, opb_irq_handler, IRQF_NO_THREAD,
+ "OPB LS Cascade", opb);
if (rc) {
printk("opb: request_irq failed: %d\n", rc);
continue;
View
5 arch/powerpc/sysdev/xics/xics-common.c
@@ -134,10 +134,11 @@ static void xics_request_ipi(void)
BUG_ON(ipi == NO_IRQ);
/*
- * IPIs are marked IRQF_PERCPU. The handler was set in map.
+ * IPIs are marked PERCPU and also IRQF_NO_THREAD as they must
+ * run in hard interrupt context. The handler was set in map.
*/
BUG_ON(request_irq(ipi, icp_ops->ipi_action,
- IRQF_PERCPU, "IPI", NULL));
+ IRQF_NO_THREAD|IRQF_PERCPU, "IPI", NULL));
}
int __init xics_smp_probe(void)
View
4 arch/s390/kernel/process.c
@@ -95,9 +95,7 @@ void cpu_idle(void)
while (!need_resched())
default_idle();
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
6 arch/s390/mm/fault.c
@@ -295,7 +295,8 @@ static inline int do_exception(struct pt_regs *regs, int access,
* user context.
*/
fault = VM_FAULT_BADCONTEXT;
- if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm))
+ if (unlikely(!user_space_fault(trans_exc_code) ||
+ !mm || pagefault_disabled()))
goto out;
address = trans_exc_code & __FAIL_ADDR_MASK;
@@ -426,7 +427,8 @@ void __kprobes do_asce_exception(struct pt_regs *regs, long pgm_int_code,
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
- if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm))
+ if (unlikely(!user_space_fault(trans_exc_code) ||
+ !mm || pagefault_disabled()))
goto no_context;
down_read(&mm->mmap_sem);
View
4 arch/score/kernel/process.c
@@ -53,9 +53,7 @@ void __noreturn cpu_idle(void)
while (!need_resched())
barrier();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/score/mm/fault.c
@@ -72,7 +72,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto bad_area_nosemaphore;
down_read(&mm->mmap_sem);
View
4 arch/sh/kernel/idle.c
@@ -112,9 +112,7 @@ void cpu_idle(void)
}
tick_nohz_restart_sched_tick();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
}
View
2  arch/sh/kernel/irq.c
@@ -149,6 +149,7 @@ void irq_ctx_exit(int cpu)
hardirq_ctx[cpu] = NULL;
}
+#ifndef CONFIG_PREEMPT_RT_FULL
asmlinkage void do_softirq(void)
{
unsigned long flags;
@@ -191,6 +192,7 @@ asmlinkage void do_softirq(void)
local_irq_restore(flags);
}
+#endif
#else
static inline void handle_one_irq(unsigned int irq)
{
View
2  arch/sh/kernel/sh_bios.c
@@ -144,8 +144,6 @@ static struct console bios_console = {
.index = -1,
};
-static struct console *early_console;
-
static int __init setup_early_printk(char *buf)
{
int keep_early = 0;
View
2  arch/sh/mm/fault_32.c
@@ -166,7 +166,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
* If we're in an interrupt, have no user context or are running
* in an atomic region then we must not take the fault:
*/
- if (in_atomic() || !mm)
+ if (!mm || pagefault_disabled())
goto no_context;
down_read(&mm->mmap_sem);
View
2  arch/sparc/kernel/irq_64.c
@@ -699,6 +699,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs)
set_irq_regs(old_regs);
}
+#ifndef CONFIG_PREEMPT_RT_FULL
void do_softirq(void)
{
unsigned long flags;
@@ -724,6 +725,7 @@ void do_softirq(void)