public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write()
@ 2011-09-19 21:20 Steven Rostedt
  2011-09-19 21:20 ` [RFC][PATCH 1/5] x86: Remove const_udelay() caring about which cpu var it uses Steven Rostedt
                   ` (6 more replies)
  0 siblings, 7 replies; 73+ messages in thread
From: Steven Rostedt @ 2011-09-19 21:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
	Christoph Lameter

I just found out that the this_cpu_*() functions do not perform the
test to see if the usage is in atomic or not. Thus, the blind
conversion of the per_cpu(*, smp_processor_id()) and the get_cpu_var()
code to this_cpu_*() introduce the regression to detect the hard
to find case where a per cpu variable is used in preempt code that
migrates and causes bugs.

I'm adding back a simple call to smp_processor_id() to
this_cpu_read() and this_cpu_write() to see what errors I find.
I found 4 places that required touch up. 3 were areas that the race
is known and we don't care, but the memcg looks very buggy.

Anyway, if I had known that the this_cpu_*() code removed this
smp_processor_id() check, I would have NAK'd all the changes to the tracing
code.

I only modified this_cpu_read and *_write() I may decide other this_cpu_*
code should be updated too. Especially the ones that return a value.

-- Steve

Steven Rostedt (5):
      x86: Remove const_udelay() caring about which cpu var it uses
      mm: Switch mod_state() to __this_cpu_read()
      memcg: Disable preemption in memcg_check_events()
      printk: Have wake_up_klogd() use __this_cpu_write()
      percpu: Add preempt checks back into this_cpu_read/write()

----
 arch/x86/lib/delay.c   |    2 +-
 include/linux/percpu.h |   17 +++++++++++++++--
 kernel/printk.c        |    2 +-
 mm/memcontrol.c        |    2 ++
 mm/vmstat.c            |    4 ++--
 5 files changed, 21 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2011-09-24  0:46 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 21:20 [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write() Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 1/5] x86: Remove const_udelay() caring about which cpu var it uses Steven Rostedt
2011-09-19 21:51   ` Christoph Lameter
2011-09-19 23:31     ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 2/5] mm: Switch mod_state() to __this_cpu_read() Steven Rostedt
2011-09-19 22:02   ` Christoph Lameter
2011-09-19 23:48     ` Steven Rostedt
2011-09-20 14:46       ` Christoph Lameter
2011-09-20 15:16         ` Steven Rostedt
2011-09-20 15:54           ` Christoph Lameter
2011-09-20 16:07             ` Steven Rostedt
2011-09-20 22:19             ` Valdis.Kletnieks
2011-09-20 13:49     ` Thomas Gleixner
2011-09-20 14:01       ` Steven Rostedt
2011-09-20 14:51       ` Christoph Lameter
2011-09-20 15:11         ` Steven Rostedt
2011-09-20 15:59           ` Christoph Lameter
2011-09-20 16:03             ` Steven Rostedt
2011-09-20 16:07               ` Christoph Lameter
2011-09-20 15:27         ` Thomas Gleixner
2011-09-20 16:02           ` Christoph Lameter
2011-09-20 16:51             ` Thomas Gleixner
2011-09-20 17:08               ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 3/5] memcg: Disable preemption in memcg_check_events() Steven Rostedt
2011-09-20 14:20   ` Johannes Weiner
2011-09-20 14:24     ` Johannes Weiner
2011-09-20 14:33       ` Steven Rostedt
2011-09-24  0:46   ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 4/5] printk: Have wake_up_klogd() use __this_cpu_write() Steven Rostedt
2011-09-19 21:54   ` Christoph Lameter
2011-09-19 23:33     ` Steven Rostedt
2011-09-20 14:54       ` Christoph Lameter
2011-09-20 14:55         ` Peter Zijlstra
2011-09-19 21:20 ` [RFC][PATCH 5/5] percpu: Add preempt checks back into this_cpu_read/write() Steven Rostedt
2011-09-19 21:49 ` [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write() Christoph Lameter
2011-09-20  3:06   ` Steven Rostedt
2011-09-20 12:44     ` Valdis.Kletnieks
2011-09-20 13:51       ` Thomas Gleixner
2011-09-20 14:58         ` Christoph Lameter
2011-09-20 15:17           ` Steven Rostedt
2011-09-20 14:57       ` Christoph Lameter
2011-09-20 15:19         ` Steven Rostedt
2011-09-20 16:08           ` Christoph Lameter
2011-09-20 16:31             ` Steven Rostedt
2011-09-20 16:56               ` Steven Rostedt
2011-09-20 17:09                 ` Peter Zijlstra
2011-09-20 17:15                   ` Steven Rostedt
2011-09-20 17:25                     ` Mathieu Desnoyers
2011-09-20 18:03                       ` Steven Rostedt
2011-09-20 18:12                         ` Mathieu Desnoyers
2011-09-20 18:27                           ` Steven Rostedt
2011-09-20 18:34                             ` Mathieu Desnoyers
2011-09-20 22:32             ` Valdis.Kletnieks
2011-09-20 22:17           ` Valdis.Kletnieks
2011-09-21  1:33             ` Steven Rostedt
2011-09-20 15:46     ` Mathieu Desnoyers
2011-09-20 16:00       ` Steven Rostedt
2011-09-20 16:10         ` Christoph Lameter
2011-09-20 16:50           ` Peter Zijlstra
2011-09-20 18:54           ` Steven Rostedt
2011-09-21 15:16             ` Christoph Lameter
2011-09-21 15:31               ` Steven Rostedt
2011-09-21 15:59                 ` Christoph Lameter
2011-09-21 16:12                   ` Steven Rostedt
2011-09-21 16:32               ` Thomas Gleixner
2011-09-20  2:20 ` Andi Kleen
2011-09-20  3:12   ` Steven Rostedt
2011-09-20  3:17     ` Steven Rostedt
2011-09-20  8:32     ` Thomas Gleixner
2011-09-20 12:10       ` Steven Rostedt
2011-09-20 15:03       ` Christoph Lameter
2011-09-20 15:07         ` Peter Zijlstra
2011-09-20 16:05           ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox