Revision f37755490fe9bf76f6ba1d8c6591745d3574a6a6 authored by Steven Rostedt (Red Hat) on 15 February 2016, 17:36:14 UTC, committed by Steven Rostedt on 15 February 2016, 18:04:46 UTC
The tracepoint infrastructure uses RCU sched protection to enable and
disable tracepoints safely. There are some instances where tracepoints are
used in infrastructure code (like kfree()) that get called after a CPU is
going offline, and perhaps when it is coming back online but hasn't been
registered yet.

This can probuce the following warning:

 [ INFO: suspicious RCU usage. ]
 4.4.0-00006-g0fe53e8-dirty #34 Tainted: G S
 -------------------------------
 include/trace/events/kmem.h:141 suspicious rcu_dereference_check() usage!

 other info that might help us debug this:

 RCU used illegally from offline CPU!  rcu_scheduler_active = 1, debug_locks = 1
 no locks held by swapper/8/0.

 stack backtrace:
  CPU: 8 PID: 0 Comm: swapper/8 Tainted: G S              4.4.0-00006-g0fe53e8-dirty #34
  Call Trace:
  [c0000005b76c78d0] [c0000000008b9540] .dump_stack+0x98/0xd4 (unreliable)
  [c0000005b76c7950] [c00000000010c898] .lockdep_rcu_suspicious+0x108/0x170
  [c0000005b76c79e0] [c00000000029adc0] .kfree+0x390/0x440
  [c0000005b76c7a80] [c000000000055f74] .destroy_context+0x44/0x100
  [c0000005b76c7b00] [c0000000000934a0] .__mmdrop+0x60/0x150
  [c0000005b76c7b90] [c0000000000e3ff0] .idle_task_exit+0x130/0x140
  [c0000005b76c7c20] [c000000000075804] .pseries_mach_cpu_die+0x64/0x310
  [c0000005b76c7cd0] [c000000000043e7c] .cpu_die+0x3c/0x60
  [c0000005b76c7d40] [c0000000000188d8] .arch_cpu_idle_dead+0x28/0x40
  [c0000005b76c7db0] [c000000000101e6c] .cpu_startup_entry+0x50c/0x560
  [c0000005b76c7ed0] [c000000000043bd8] .start_secondary+0x328/0x360
  [c0000005b76c7f90] [c000000000008a6c] start_secondary_prolog+0x10/0x14

This warning is not a false positive either. RCU is not protecting code that
is being executed while the CPU is offline.

Instead of playing "whack-a-mole(TM)" and adding conditional statements to
the tracepoints we find that are used in this instance, simply add a
cpu_online() test to the tracepoint code where the tracepoint will be
ignored if the CPU is offline.

Use of raw_smp_processor_id() is fine, as there should never be a case where
the tracepoint code goes from running on a CPU that is online and suddenly
gets migrated to a CPU that is offline.

Link: http://lkml.kernel.org/r/1455387773-4245-1-git-send-email-kda@linux-powerpc.org

Reported-by: Denis Kirjanov <kda@linux-powerpc.org>
Fixes: 97e1c18e8d17b ("tracing: Kernel Tracepoints")
Cc: stable@vger.kernel.org # v2.6.28+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 18558ca
Raw File
00-INDEX

This is a brief list of all the files in ./linux/Documentation and what
they contain. If you add a documentation file, please list it here in
alphabetical order as well, or risk being hunted down like a rabid dog.
Please keep the descriptions small enough to fit on one line.
							 Thanks -- Paul G.

Following translations are available on the WWW:

   - Japanese, maintained by the JF Project (jf@listserv.linux.or.jp), at
     http://linuxjf.sourceforge.jp/

00-INDEX
	- this file.
ABI/
	- info on kernel <-> userspace ABI and relative interface stability.

BUG-HUNTING
	- brute force method of doing binary search of patches to find bug.
Changes
	- list of changes that break older software packages.
CodingStyle
	- how the maintainers expect the C code in the kernel to look.
DMA-API.txt
	- DMA API, pci_ API & extensions for non-consistent memory machines.
DMA-API-HOWTO.txt
	- Dynamic DMA mapping Guide
DMA-ISA-LPC.txt
	- How to do DMA with ISA (and LPC) devices.
DMA-attributes.txt
	- listing of the various possible attributes a DMA region can have
DocBook/
	- directory with DocBook templates etc. for kernel documentation.
EDID/
	- directory with info on customizing EDID for broken gfx/displays.
HOWTO
	- the process and procedures of how to do Linux kernel development.
IPMI.txt
	- info on Linux Intelligent Platform Management Interface (IPMI) Driver.
IRQ-affinity.txt
	- how to select which CPU(s) handle which interrupt events on SMP.
IRQ-domain.txt
	- info on interrupt numbering and setting up IRQ domains.
IRQ.txt
	- description of what an IRQ is.
Intel-IOMMU.txt
	- basic info on the Intel IOMMU virtualization support.
Makefile
	- some files in Documentation dir are actually sample code to build
ManagementStyle
	- how to (attempt to) manage kernel hackers.
RCU/
	- directory with info on RCU (read-copy update).
SAK.txt
	- info on Secure Attention Keys.
SM501.txt
	- Silicon Motion SM501 multimedia companion chip
SecurityBugs
	- procedure for reporting security bugs found in the kernel.
SubmitChecklist
	- Linux kernel patch submission checklist.
SubmittingDrivers
	- procedure to get a new driver source included into the kernel tree.
SubmittingPatches
	- procedure to get a source patch included into the kernel tree.
VGA-softcursor.txt
	- how to change your VGA cursor from a blinking underscore.
accounting/
	- documentation on accounting and taskstats.
acpi/
	- info on ACPI-specific hooks in the kernel.
aoe/
	- description of AoE (ATA over Ethernet) along with config examples.
applying-patches.txt
	- description of various trees and how to apply their patches.
arm/
	- directory with info about Linux on the ARM architecture.
arm64/
	- directory with info about Linux on the 64 bit ARM architecture.
assoc_array.txt
	- generic associative array intro.
atomic_ops.txt
	- semantics and behavior of atomic and bitmask operations.
auxdisplay/
	- misc. LCD driver documentation (cfag12864b, ks0108).
backlight/
	- directory with info on controlling backlights in flat panel displays
bad_memory.txt
	- how to use kernel parameters to exclude bad RAM regions.
basic_profiling.txt
	- basic instructions for those who wants to profile Linux kernel.
bcache.txt
	- Block-layer cache on fast SSDs to improve slow (raid) I/O performance.
binfmt_misc.txt
	- info on the kernel support for extra binary formats.
blackfin/
	- directory with documentation for the Blackfin arch.
block/
	- info on the Block I/O (BIO) layer.
blockdev/
	- info on block devices & drivers
braille-console.txt
	- info on how to use serial devices for Braille support.
bt8xxgpio.txt
	- info on how to modify a bt8xx video card for GPIO usage.
btmrvl.txt
	- info on Marvell Bluetooth driver usage.
bus-devices/
	- directory with info on TI GPMC (General Purpose Memory Controller)
bus-virt-phys-mapping.txt
	- how to access I/O mapped memory from within device drivers.
cachetlb.txt
	- describes the cache/TLB flushing interfaces Linux uses.
cdrom/
	- directory with information on the CD-ROM drivers that Linux has.
cgroups/
	- cgroups features, including cpusets and memory controller.
circular-buffers.txt
	- how to make use of the existing circular buffer infrastructure
clk.txt
	- info on the common clock framework
coccinelle.txt
	- info on how to get and use the Coccinelle code checking tool.
connector/
	- docs on the netlink based userspace<->kernel space communication mod.
console/
	- documentation on Linux console drivers.
cpu-freq/
	- info on CPU frequency and voltage scaling.
cpu-hotplug.txt
	- document describing CPU hotplug support in the Linux kernel.
cpu-load.txt
	- document describing how CPU load statistics are collected.
cpuidle/
	- info on CPU_IDLE, CPU idle state management subsystem.
cputopology.txt
	- documentation on how CPU topology info is exported via sysfs.
crc32.txt
	- brief tutorial on CRC computation
cris/
	- directory with info about Linux on CRIS architecture.
crypto/
	- directory with info on the Crypto API.
dcdbas.txt
	- information on the Dell Systems Management Base Driver.
debugging-modules.txt
	- some notes on debugging modules after Linux 2.6.3.
debugging-via-ohci1394.txt
	- how to use firewire like a hardware debugger memory reader.
dell_rbu.txt
	- document demonstrating the use of the Dell Remote BIOS Update driver.
development-process/
	- how to work with the mainline kernel development process.
device-mapper/
	- directory with info on Device Mapper.
devices.txt
	- plain ASCII listing of all the nodes in /dev/ with major minor #'s.
devicetree/
	- directory with info on device tree files used by OF/PowerPC/ARM
digsig.txt
	-info on the Digital Signature Verification API
dma-buf-sharing.txt
	- the DMA Buffer Sharing API Guide
dontdiff
	- file containing a list of files that should never be diff'ed.
driver-model/
	- directory with info about Linux driver model.
dvb/
	- info on Linux Digital Video Broadcast (DVB) subsystem.
dynamic-debug-howto.txt
	- how to use the dynamic debug (dyndbg) feature.
early-userspace/
	- info about initramfs, klibc, and userspace early during boot.
edac.txt
	- information on EDAC - Error Detection And Correction
efi-stub.txt
	- How to use the EFI boot stub to bypass GRUB or elilo on EFI systems.
eisa.txt
	- info on EISA bus support.
email-clients.txt
	- info on how to use e-mail to send un-mangled (git) patches.
extcon/
	- directory with porting guide for Android kernel switch driver.
fault-injection/
	- dir with docs about the fault injection capabilities infrastructure.
fb/
	- directory with info on the frame buffer graphics abstraction layer.
filesystems/
	- info on the vfs and the various filesystems that Linux supports.
firmware_class/
	- request_firmware() hotplug interface info.
flexible-arrays.txt
	- how to make use of flexible sized arrays in linux
fmc/
	- information about the FMC bus abstraction
frv/
	- Fujitsu FR-V Linux documentation.
futex-requeue-pi.txt
	- info on requeueing of tasks from a non-PI futex to a PI futex
gcov.txt
	- use of GCC's coverage testing tool "gcov" with the Linux kernel
gpio/
	- gpio related documentation
hid/
	- directory with information on human interface devices
highuid.txt
	- notes on the change from 16 bit to 32 bit user/group IDs.
hsi.txt
	- HSI subsystem overview.
hwspinlock.txt
	- hardware spinlock provides hardware assistance for synchronization
timers/
	- info on the timer related topics
hw_random.txt
	- info on Linux support for random number generator in i8xx chipsets.
hwmon/
	- directory with docs on various hardware monitoring drivers.
i2c/
	- directory with info about the I2C bus/protocol (2 wire, kHz speed).
i2o/
	- directory with info about the Linux I2O subsystem.
x86/i386/
	- directory with info about Linux on Intel 32 bit architecture.
ia64/
	- directory with info about Linux on Intel 64 bit architecture.
infiniband/
	- directory with documents concerning Linux InfiniBand support.
init.txt
	- what to do when the kernel can't find the 1st process to run.
initrd.txt
	- how to use the RAM disk as an initial/temporary root filesystem.
input/
	- info on Linux input device support.
intel_txt.txt
	- info on intel Trusted Execution Technology (intel TXT).
io-mapping.txt
	- description of io_mapping functions in linux/io-mapping.h
io_ordering.txt
	- info on ordering I/O writes to memory-mapped addresses.
ioctl/
	- directory with documents describing various IOCTL calls.
iostats.txt
	- info on I/O statistics Linux kernel provides.
irqflags-tracing.txt
	- how to use the irq-flags tracing feature.
isapnp.txt
	- info on Linux ISA Plug & Play support.
isdn/
	- directory with info on the Linux ISDN support, and supported cards.
java.txt
	- info on the in-kernel binary support for Java(tm).
ja_JP/
	- directory with Japanese translations of various documents
kbuild/
	- directory with info about the kernel build process.
kdump/
	- directory with mini HowTo on getting the crash dump code to work.
kernel-doc-nano-HOWTO.txt
	- mini HowTo on generation and location of kernel documentation files.
kernel-docs.txt
	- listing of various WWW + books that document kernel internals.
kernel-parameters.txt
	- summary listing of command line / boot prompt args for the kernel.
kernel-per-CPU-kthreads.txt
	- List of all per-CPU kthreads and how they introduce jitter.
kmemcheck.txt
	- info on dynamic checker that detects uses of uninitialized memory.
kmemleak.txt
	- info on how to make use of the kernel memory leak detection system
ko_KR/
	- directory with Korean translations of various documents
kobject.txt
	- info of the kobject infrastructure of the Linux kernel.
kprobes.txt
	- documents the kernel probes debugging feature.
kref.txt
	- docs on adding reference counters (krefs) to kernel objects.
kselftest.txt
	- small unittests for (some) individual codepaths in the kernel.
laptops/
	- directory with laptop related info and laptop driver documentation.
ldm.txt
	- a brief description of LDM (Windows Dynamic Disks).
leds/
	- directory with info about LED handling under Linux.
local_ops.txt
	- semantics and behavior of local atomic operations.
locking/
	- directory with info about kernel locking primitives
lockup-watchdogs.txt
	- info on soft and hard lockup detectors (aka nmi_watchdog).
logo.gif
	- full colour GIF image of Linux logo (penguin - Tux).
logo.txt
	- info on creator of above logo & site to get additional images from.
lzo.txt
	- kernel LZO decompressor input formats
m68k/
	- directory with info about Linux on Motorola 68k architecture.
magic-number.txt
	- list of magic numbers used to mark/protect kernel data structures.
mailbox.txt
	- How to write drivers for the common mailbox framework (IPC).
md.txt
	- info on boot arguments for the multiple devices driver.
media-framework.txt
	- info on media framework, its data structures, functions and usage.
memory-barriers.txt
	- info on Linux kernel memory barriers.
memory-devices/
	- directory with info on parts like the Texas Instruments EMIF driver
memory-hotplug.txt
	- Hotpluggable memory support, how to use and current status.
metag/
	- directory with info about Linux on Meta architecture.
mips/
	- directory with info about Linux on MIPS architecture.
misc-devices/
	- directory with info about devices using the misc dev subsystem
mmc/
	- directory with info about the MMC subsystem
mn10300/
	- directory with info about the mn10300 architecture port
module-signing.txt
	- Kernel module signing for increased security when loading modules.
mtd/
	- directory with info about memory technology devices (flash)
mono.txt
	- how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
namespaces/
	- directory with various information about namespaces
netlabel/
	- directory with information on the NetLabel subsystem.
networking/
	- directory with info on various aspects of networking with Linux.
nfc/
	- directory relating info about Near Field Communications support.
nommu-mmap.txt
	- documentation about no-mmu memory mapping support.
numastat.txt
	- info on how to read Numa policy hit/miss statistics in sysfs.
oops-tracing.txt
	- how to decode those nasty internal kernel error dump messages.
padata.txt
	- An introduction to the "padata" parallel execution API
parisc/
	- directory with info on using Linux on PA-RISC architecture.
parport.txt
	- how to use the parallel-port driver.
parport-lowlevel.txt
	- description and usage of the low level parallel port functions.
pcmcia/
	- info on the Linux PCMCIA driver.
percpu-rw-semaphore.txt
	- RCU based read-write semaphore optimized for locking for reading
phy.txt
	- Description of the generic PHY framework.
pi-futex.txt
	- documentation on lightweight priority inheritance futexes.
pinctrl.txt
	- info on pinctrl subsystem and the PINMUX/PINCONF and drivers
pnp.txt
	- Linux Plug and Play documentation.
power/
	- directory with info on Linux PCI power management.
powerpc/
	- directory with info on using Linux with the PowerPC.
prctl/
	- directory with info on the priveledge control subsystem
preempt-locking.txt
	- info on locking under a preemptive kernel.
printk-formats.txt
	- how to get printk format specifiers right
pps/
	- directory with information on the pulse-per-second support
ptp/
	- directory with info on support for IEEE 1588 PTP clocks in Linux.
pwm.txt
	- info on the pulse width modulation driver subsystem
ramoops.txt
	- documentation of the ramoops oops/panic logging module.
rapidio/
	- directory with info on RapidIO packet-based fabric interconnect
rbtree.txt
	- info on what red-black trees are and what they are for.
remoteproc.txt
	- info on how to handle remote processor (e.g. AMP) offloads/usage.
rfkill.txt
	- info on the radio frequency kill switch subsystem/support.
robust-futex-ABI.txt
	- documentation of the robust futex ABI.
robust-futexes.txt
	- a description of what robust futexes are.
rpmsg.txt
	- info on the Remote Processor Messaging (rpmsg) Framework
rtc.txt
	- notes on how to use the Real Time Clock (aka CMOS clock) driver.
s390/
	- directory with info on using Linux on the IBM S390.
scheduler/
	- directory with info on the scheduler.
scsi/
	- directory with info on Linux scsi support.
security/
	- directory that contains security-related info
serial/
	- directory with info on the low level serial API.
serial-console.txt
	- how to set up Linux with a serial line console as the default.
sgi-ioc4.txt
	- description of the SGI IOC4 PCI (multi function) device.
sh/
	- directory with info on porting Linux to a new architecture.
smsc_ece1099.txt
	-info on the smsc Keyboard Scan Expansion/GPIO Expansion device.
sound/
	- directory with info on sound card support.
sparse.txt
	- info on how to obtain and use the sparse tool for typechecking.
spi/
	- overview of Linux kernel Serial Peripheral Interface (SPI) support.
stable_api_nonsense.txt
	- info on why the kernel does not have a stable in-kernel api or abi.
stable_kernel_rules.txt
	- rules and procedures for the -stable kernel releases.
static-keys.txt
	- info on how static keys allow debug code in hotpaths via patching
svga.txt
	- short guide on selecting video modes at boot via VGA BIOS.
sysfs-rules.txt
	- How not to use sysfs.
sysctl/
	- directory with info on the /proc/sys/* files.
sysrq.txt
	- info on the magic SysRq key.
target/
	- directory with info on generating TCM v4 fabric .ko modules
this_cpu_ops.txt
	- List rationale behind and the way to use this_cpu operations.
thermal/
	- directory with information on managing thermal issues (CPU/temp)
trace/
	- directory with info on tracing technologies within linux
unaligned-memory-access.txt
	- info on how to avoid arch breaking unaligned memory access in code.
unicode.txt
	- info on the Unicode character/font mapping used in Linux.
unshare.txt
	- description of the Linux unshare system call.
usb/
	- directory with info regarding the Universal Serial Bus.
vDSO/
	- directory with info regarding virtual dynamic shared objects
vfio.txt
	- info on Virtual Function I/O used in guest/hypervisor instances.
vgaarbiter.txt
	- info on enable/disable the legacy decoding on different VGA devices
video-output.txt
	- sysfs class driver interface to enable/disable a video output device.
video4linux/
	- directory with info regarding video/TV/radio cards and linux.
virtual/
	- directory with information on the various linux virtualizations.
vm/
	- directory with info on the Linux vm code.
vme_api.txt
	- file relating info on the VME bus API in linux
volatile-considered-harmful.txt
	- Why the "volatile" type class should not be used
w1/
	- directory with documents regarding the 1-wire (w1) subsystem.
watchdog/
	- how to auto-reboot Linux if it has "fallen and can't get up". ;-)
wimax/
	- directory with info about Intel Wireless Wimax Connections
workqueue.txt
	- information on the Concurrency Managed Workqueue implementation
x86/x86_64/
	- directory with info on Linux support for AMD x86-64 (Hammer) machines.
xillybus.txt
	- Overview and basic ui of xillybus driver
xtensa/
	- directory with documents relating to arch/xtensa port/implementation
xz.txt
	- how to make use of the XZ data compression within linux kernel
zh_CN/
	- directory with Chinese translations of various documents
zorro.txt
	- info on writing drivers for Zorro bus devices found on Amigas.
back to top