linux_dsm_epyc7002/include/trace/events
Linus Torvalds 4e02370f64 During testing Sedat Dilek hit a "suspicious RCU usage" splat that pointed
out a real bug. During suspend and resume the tlb_flush tracepoint is
 called when the CPU is going offline. As the CPU has been noted as offline,
 RCU is ignoring that CPU, which means that it can not use RCU protected
 locks. When tracepoints are activated, they require RCU locking, and
 if RCU is ignoring a CPU that runs a tracepoint, there is a chance that
 the tracepoint could cause corruption.
 
 The solution was to change the tracepoint into a TRACE_EVENT_CONDITION()
 which allows us to check a condition to determine if the tracepoint
 should be called or not. If the condition is not met, the rcu protected
 code will not be executed. By adding the condition
 "cpu_online(smp_processor_id())", this will prevent the RCU protected
 code from being executed if the CPU is marked offline.
 
 After adding this, another bug was discovered. As RCU checks rcu callers,
 if a rcu call is not done, there is no check (obviously). We found that
 tracepoints could be added in RCU ignored locations and not have lockdep
 complain until the tracepoint is activated. This missed places where
 tracepoints were added in places they should not have been. To fix this,
 code was added in 3.18 that if lockdep is enabled, any tracepoint will
 still call the rcu checks even if the tracepoint is not enabled. The bug
 here, is that the check does not take the CONDITION into account. As the
 condition may prevent tracepoints from being activated in RCU ignored
 areas (as the one patch does), we get false positives when we enable
 lockdep and hit a tracepoint that the condition prevents it from being
 called in a RCU ignored location. The fix for this is to add the
 CONDITION to the rcu checks, even if the tracepoint is not enabled.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJU1rQfAAoJEEjnJuOKh9ld19UH/juFLZFjpYBgtRmbCZa/54Zk
 i2Fa3U8jQe8MHHEYOjCLT9MQTYo/42btmJhr7kWKtIoUgDEli4lkOpbs+H0qar5y
 Vv9+1cLeNFQzgIE3nwV7cjAw7Jufoyzd1lstDqIQvcmzZnQ5sNyyVeigMcxGv8Ls
 4FyqzG6zCVgiDL4LyYNHdNcMr6qLs3KTFDEqp+kQreeO7R1r3ZEpq3JoWaEUgoPP
 qrYv/rqVosLBUGA0pd7RmiGOxhjeKm15qz1GkiPeeus6DDWC6bvPC8cAc/FfkXH0
 hYpoQghSZVnXGy0LzVsd44gj7tYx1FHEpYy1s8G6d5WJcNOGZ6OoZOdOZMyjPVw=
 =PeL2
 -----END PGP SIGNATURE-----

Merge tag 'trace-fixes-v3.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull ftrace fixes from Steven Rostedt:
 "During testing Sedat Dilek hit a "suspicious RCU usage" splat that
  pointed out a real bug.  During suspend and resume the tlb_flush
  tracepoint is called when the CPU is going offline.  As the CPU has
  been noted as offline, RCU is ignoring that CPU, which means that it
  can not use RCU protected locks.  When tracepoints are activated, they
  require RCU locking, and if RCU is ignoring a CPU that runs a
  tracepoint, there is a chance that the tracepoint could cause
  corruption.

  The solution was to change the tracepoint into a
  TRACE_EVENT_CONDITION() which allows us to check a condition to
  determine if the tracepoint should be called or not.  If the condition
  is not met, the rcu protected code will not be executed.  By adding
  the condition "cpu_online(smp_processor_id())", this will prevent the
  RCU protected code from being executed if the CPU is marked offline.

  After adding this, another bug was discovered.  As RCU checks rcu
  callers, if a rcu call is not done, there is no check (obviously).  We
  found that tracepoints could be added in RCU ignored locations and not
  have lockdep complain until the tracepoint is activated.  This missed
  places where tracepoints were added in places they should not have
  been.  To fix this, code was added in 3.18 that if lockdep is enabled,
  any tracepoint will still call the rcu checks even if the tracepoint
  is not enabled.  The bug here, is that the check does not take the
  CONDITION into account.  As the condition may prevent tracepoints from
  being activated in RCU ignored areas (as the one patch does), we get
  false positives when we enable lockdep and hit a tracepoint that the
  condition prevents it from being called in a RCU ignored location.

  The fix for this is to add the CONDITION to the rcu checks, even if
  the tracepoint is not enabled"

* tag 'trace-fixes-v3.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  x86/tlb/trace: Do not trace on CPU that is offline
  tracing: Add condition check to RCU lockdep checks
2015-02-08 18:08:14 -08:00
..
9p.h 9p: trace: use %*ph to dump buffer 2013-05-28 13:42:08 -05:00
asoc.h ASoC: Remove snd_soc_cache_sync() implementation 2014-11-09 09:06:30 +00:00
bcache.h bcache: fix crash in bcache_btree_node_alloc_fail tracepoint 2014-08-04 15:23:03 -07:00
block.h blktrace: fix accounting of partially completed requests 2014-03-05 16:11:21 -07:00
btrfs.h Btrfs: fix wrong parse of extent map's tracepoint 2014-09-18 07:14:47 -07:00
compaction.h mm/compaction: do not count migratepages when unnecessary 2014-06-04 16:54:07 -07:00
context_tracking.h context_tracking: User/kernel broundary cross trace events 2013-08-14 17:14:48 +02:00
ext3.h jbd: change journal_invalidatepage() to accept length 2013-05-21 23:26:36 -04:00
ext4.h ext4: change LRU to round-robin in extent status tree shrinker 2014-11-25 11:45:37 -05:00
f2fs.h f2fs: introduce FITRIM in f2fs_ioctl 2014-09-30 15:06:09 -07:00
fence.h fence: dma-buf cross-device synchronization (v18) 2014-07-08 12:18:56 -07:00
filelock.h locks: generic_delete_lease doesn't need a file_lock at all 2014-10-07 14:06:12 -04:00
filemap.h mm: trace filemap add and del 2013-04-29 15:54:28 -07:00
gfpflags.h mm: get rid of __GFP_KMEMCG 2014-06-04 16:53:56 -07:00
gpio.h gpio: add trace events for setting direction and value 2011-05-20 00:40:19 -06:00
host1x.h gpu: host1x: Use struct host1x_bo pointers in traces 2014-11-13 16:11:32 +01:00
hswadsp.h Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next 2014-03-12 23:04:35 +00:00
i2c.h i2c: Add message transfer tracepoints for SMBUS [ver #2] 2014-03-13 22:15:07 +01:00
intel-sst.h Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next 2014-03-12 23:04:35 +00:00
iommu.h iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
ipi.h tracepoint: add generic tracepoint definitions for IPI tracing 2014-08-07 20:40:40 -04:00
irq.h net: treewide: Fix typo found in DocBook/networking.xml 2014-09-05 17:35:28 -07:00
jbd2.h jbd2: trace when lock_buffer in do_get_write_access takes a long time 2013-04-21 16:47:54 -04:00
jbd.h jbd: Write journal superblock with WRITE_FUA after checkpointing 2012-05-15 23:34:37 +02:00
kmem.h mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag() 2013-11-13 12:09:10 +09:00
kvm.h KVM: fix sparse warning in include/trace/events/kvm.h 2015-01-19 11:07:57 +01:00
lock.h
mce.h
migrate.h mm tracing: tell mm_migrate_pages event about numa_misplaced 2014-08-06 18:01:18 -07:00
module.h module: Replace module_ref with atomic_t refcnt 2014-11-11 17:07:46 +10:30
napi.h
net.h net: Rename skb->rxhash to skb->hash 2014-03-26 15:58:20 -04:00
nmi.h x86: Add NMI duration tracepoints 2013-06-23 11:52:58 +02:00
oom.h mm, oom: change type of oom_score_adj to short 2012-12-11 17:22:27 -08:00
pagemap.h mm: pagemap: avoid unnecessary overhead when tracepoints are deactivated 2014-08-06 18:01:20 -07:00
power_cpu_migrate.h ARM: bL_switcher/trace: Add trace trigger for trace bootstrapping 2013-09-23 18:47:30 -04:00
power.h PM / sleep: trace events for device PM callbacks 2014-06-11 02:16:48 +02:00
printk.h printk/tracing: rework console tracing 2013-04-29 18:28:13 -07:00
random.h random: convert DEBUG_ENT to tracepoints 2013-10-10 14:32:23 -04:00
rcu.h rcu: Remove redundant TREE_PREEMPT_RCU config option 2014-10-29 10:20:05 -07:00
regmap.h regmap: Add support for discarding parts of the register cache 2013-05-12 18:46:47 +04:00
regulator.h
rpm.h device.h: audit and cleanup users in main include dir 2012-03-16 10:38:24 -04:00
sched.h sched: Fix the PREEMPT_ACTIVE check in __trace_sched_switch_state() 2014-10-28 10:47:53 +01:00
scsi.h scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 2014-11-24 20:01:40 +01:00
signal.h tracing: let trace_signal_generate() report more info, kill overflow_fail/lose_info 2012-01-13 18:48:50 +01:00
skb.h
sock.h core: add tracepoints for queueing skb to rcvbuf 2011-06-21 16:06:10 -07:00
spi.h spi: Provide common spi_message processing loop 2013-10-11 20:09:50 +01:00
sunrpc.h sunrpc: add some tracepoints around enqueue and dequeue of svc_xprt 2014-12-09 11:29:14 -05:00
swiotlb.h tracing/events: Add bounce tracing to swiotbl 2013-10-02 12:53:26 -04:00
syscalls.h tracepoint: Fix sparse warnings in tracepoint.c 2014-04-09 10:12:11 -04:00
target.h Merge remote-tracking branch 'scsi-queue/drivers-for-3.19' into for-linus 2014-12-18 05:56:29 -08:00
task.h exec: kill bprm->tcomm[], simplify the "basename" logic 2014-04-07 16:36:05 -07:00
thermal.h thermal: trace: Trace when temperature is above a trip point 2014-07-29 09:28:43 -04:00
thp.h powerpc/thp: Add tracepoints to track hugepage invalidate 2014-08-13 18:20:42 +10:00
timer.h Merge branch 'timers-nohz-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-05 13:23:27 -07:00
tlb.h x86/tlb/trace: Do not trace on CPU that is offline 2015-02-07 19:34:55 -05:00
udp.h udp: add tracepoints for queueing skb to rcvbuf 2011-06-21 16:06:10 -07:00
v4l2.h [media] v4l: add stream format for SDR receiver 2014-03-05 14:15:12 -03:00
vmscan.h mm: shrinker: add nid to tracepoint output 2014-06-04 16:54:04 -07:00
workqueue.h workqueue: rename cpu_workqueue to pool_workqueue 2013-02-13 19:29:12 -08:00
writeback.h Most of the changes were largely clean ups, and some documentation. 2014-04-03 10:26:31 -07:00
xen.h xen/mmu: Use Xen specific TLB flush instead of the generic one. 2012-10-31 12:38:31 -04:00