This includes two fixes.

The first is something that has come up a few times and has been
 worked out individually, but it's come up now enough that the problem
 should be generic. Tracepoints are protected by RCU sched. There are
 several tracepoints within core infrastructure like kfree().
 If a tracepoint is called when the CPU is going down, or when it's
 coming up but has yet to be recognized by RCU, a RCU warning is
 triggered. This is a true bug as that tracepoint is not protected by
 RCU. Usually, this is taken care of by testing for cpu online as
 a tracepoint condition. But as this is happening more often, moving
 it from a individual tracepoint to a check in the tracepoint infrastructure
 is more robust.
 
 Note, there is now a duplicate of a cpu online test, because this update
 does not remove the individual checks. But the overhead is small enough
 that the removal can be done in another release.
 
 The second change is strange linker breakage due to the branch tracer's
 builtin_constant_p() check failing, and treating the condition as a
 variable instead of a constant. Arnd Bergmann found that this can be
 fixed by testing !!(cond) instead of just (cond).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWw2vTAAoJEKKk/i67LK/8vkMIAI+Fx+S9sCeWVGp4VZ3DKH9K
 DibRD/2KREZe1AjYEU8ZAgo+VsFzW8OHiI1TI/1jP61YkiQSIhu6kVdPCoLG5buy
 8WwiKEQ94VWC1hbPOiiq3K7THEu+M8zuFdU3+odS8E3sXIGqKPKQ3iFwwfTVHI6o
 /cMTuefqsxo/hj8VwwaZdwlgWwLltM8sR040auTTEsqBLZ7D1q0aCyBrnju3FtBt
 uSIPK91d92ANkpq3ELDihxBa41XSEahYgGm/ozewjHwpooWvIQz4tpGaxxkyltuE
 RzeYBrM5LNBQUaXZ6C6jAdL0Y+bukS2MdNUjv8U6LwKbUvQoLuYteGEQ9g/m+mE=
 =8LDX
 -----END PGP SIGNATURE-----

Merge tag 'trace-fixes-v4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "This includes two fixes.

  The first is something that has come up a few times and has been
  worked out individually, but it's come up now enough that the problem
  should be generic.  Tracepoints are protected by RCU sched.  There are
  several tracepoints within core infrastructure like kfree().  If a
  tracepoint is called when the CPU is going down, or when it's coming
  up but has yet to be recognized by RCU, a RCU warning is triggered.

  This is a true bug as that tracepoint is not protected by RCU.
  Usually, this is taken care of by testing for cpu online as a
  tracepoint condition.  But as this is happening more often, moving it
  from a individual tracepoint to a check in the tracepoint
  infrastructure is more robust.

  Note, there is now a duplicate of a cpu online test, because this
  update does not remove the individual checks.  But the overhead is
  small enough that the removal can be done in another release.

  The second change is strange linker breakage due to the branch
  tracer's builtin_constant_p() check failing, and treating the
  condition as a variable instead of a constant.  Arnd Bergmann found
  that this can be fixed by testing !!(cond) instead of just (cond)"

* tag 'trace-fixes-v4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix freak link error caused by branch tracer
  tracepoints: Do not trace when cpu is offline
This commit is contained in:
Linus Torvalds 2016-02-17 11:35:41 -08:00
commit a9f70bd4e7
2 changed files with 6 additions and 1 deletions

View File

@ -144,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
*/
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
#define __trace_if(cond) \
if (__builtin_constant_p((cond)) ? !!(cond) : \
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
({ \
int ______r; \
static struct ftrace_branch_data \

View File

@ -14,8 +14,10 @@
* See the file COPYING for more details.
*/
#include <linux/smp.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/cpumask.h>
#include <linux/rcupdate.h>
#include <linux/tracepoint-defs.h>
@ -132,6 +134,9 @@ extern void syscall_unregfunc(void);
void *it_func; \
void *__data; \
\
if (!cpu_online(raw_smp_processor_id())) \
return; \
\
if (!(cond)) \
return; \
prercu; \