Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Paul E. McKenney
On Fri, Sep 21, 2007 at 05:32:08PM -0400, Steven Rostedt wrote: > > -- > On Fri, 21 Sep 2007, Paul E. McKenney wrote: > > > On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: > > > In recent development of the RT kernel, some of our experimental code > > > corrupted the rcu header.

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Paul E. McKenney
On Sat, Sep 22, 2007 at 03:04:47AM -0400, Kyle Moffett wrote: > On Sep 21, 2007, at 17:32:08, Steven Rostedt wrote: > >On Fri, 21 Sep 2007, Paul E. McKenney wrote: > >>On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: > >>>-#define RCU_HEAD_INIT { .next = NULL, .func = NULL } >

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Kyle Moffett
On Sep 21, 2007, at 17:32:08, Steven Rostedt wrote: On Fri, 21 Sep 2007, Paul E. McKenney wrote: On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: -#define RCU_HEAD_INIT { .next = NULL, .func = NULL } +#ifdef CONFIG_RCU_CRC_HEADER_CHECK + +#define RCU_CRC_MAGIC 0xC4809168UL

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Kyle Moffett
On Sep 21, 2007, at 17:32:08, Steven Rostedt wrote: On Fri, 21 Sep 2007, Paul E. McKenney wrote: On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: -#define RCU_HEAD_INIT { .next = NULL, .func = NULL } +#ifdef CONFIG_RCU_CRC_HEADER_CHECK + +#define RCU_CRC_MAGIC 0xC4809168UL

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Paul E. McKenney
On Sat, Sep 22, 2007 at 03:04:47AM -0400, Kyle Moffett wrote: On Sep 21, 2007, at 17:32:08, Steven Rostedt wrote: On Fri, 21 Sep 2007, Paul E. McKenney wrote: On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: -#define RCU_HEAD_INIT { .next = NULL, .func = NULL } +#ifdef

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-22 Thread Paul E. McKenney
On Fri, Sep 21, 2007 at 05:32:08PM -0400, Steven Rostedt wrote: -- On Fri, 21 Sep 2007, Paul E. McKenney wrote: On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: In recent development of the RT kernel, some of our experimental code corrupted the rcu header. But the side

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- On Fri, 21 Sep 2007, Paul E. McKenney wrote: > On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: > > In recent development of the RT kernel, some of our experimental code > > corrupted the rcu header. But the side effect (crashing) didn't rear its > > ugly head until way after

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Paul E. McKenney
On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: > In recent development of the RT kernel, some of our experimental code > corrupted the rcu header. But the side effect (crashing) didn't rear its > ugly head until way after the fact. Discussing this with Paul, he > suggested that

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- > > This has been wondering me some time. Kernel oopses also use [<%p>], > but what really for are two sort of braces needed? I believe the notation of [] has always been a representation of instruction pointer. Seems that's what's used for all outputs of instruction pointers that I've seen

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Jan Engelhardt
On Sep 21 2007 14:02, Peter Zijlstra wrote: >> +if (unlikely(head->crc != rcu_crc_calc(head)) && !once) { >> +once++; >> +printk("BUG: RCU check failed!"); >> +if (head->caller) >> +printk(" (caller=%p)", >> +

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- On Fri, 21 Sep 2007, Peter Zijlstra wrote: > On Thu, 20 Sep 2007 14:34:11 -0400 Steven Rostedt <[EMAIL PROTECTED]> > wrote: > > > > +static inline void rcu_crc_check(struct rcu_head *head) > > +{ > > + static int once; > > + if (unlikely(head->crc != rcu_crc_calc(head)) && !once) { > > +

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Peter Zijlstra
On Thu, 20 Sep 2007 14:34:11 -0400 Steven Rostedt <[EMAIL PROTECTED]> wrote: > +static inline void rcu_crc_check(struct rcu_head *head) > +{ > + static int once; > + if (unlikely(head->crc != rcu_crc_calc(head)) && !once) { > + once++; > + printk("BUG: RCU check

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Jan Engelhardt
On Sep 21 2007 14:02, Peter Zijlstra wrote: +if (unlikely(head-crc != rcu_crc_calc(head)) !once) { +once++; +printk(BUG: RCU check failed!); +if (head-caller) +printk( (caller=%p), + head-caller);

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- On Fri, 21 Sep 2007, Peter Zijlstra wrote: On Thu, 20 Sep 2007 14:34:11 -0400 Steven Rostedt [EMAIL PROTECTED] wrote: +static inline void rcu_crc_check(struct rcu_head *head) +{ + static int once; + if (unlikely(head-crc != rcu_crc_calc(head)) !once) { + once++;

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- This has been wondering me some time. Kernel oopses also use [%p], but what really for are two sort of braces needed? I believe the notation of [some-hex-number] has always been a representation of instruction pointer. Seems that's what's used for all outputs of instruction pointers that

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Paul E. McKenney
On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: In recent development of the RT kernel, some of our experimental code corrupted the rcu header. But the side effect (crashing) didn't rear its ugly head until way after the fact. Discussing this with Paul, he suggested that RCU

Re: [RFC PATCH] Add CRC checksum for RCU lists

2007-09-21 Thread Steven Rostedt
-- On Fri, 21 Sep 2007, Paul E. McKenney wrote: On Thu, Sep 20, 2007 at 02:34:11PM -0400, Steven Rostedt wrote: In recent development of the RT kernel, some of our experimental code corrupted the rcu header. But the side effect (crashing) didn't rear its ugly head until way after the

[RFC PATCH] Add CRC checksum for RCU lists

2007-09-20 Thread Steven Rostedt
In recent development of the RT kernel, some of our experimental code corrupted the rcu header. But the side effect (crashing) didn't rear its ugly head until way after the fact. Discussing this with Paul, he suggested that RCU should have a "self checking" mechanism to detect these kind of

[RFC PATCH] Add CRC checksum for RCU lists

2007-09-20 Thread Steven Rostedt
In recent development of the RT kernel, some of our experimental code corrupted the rcu header. But the side effect (crashing) didn't rear its ugly head until way after the fact. Discussing this with Paul, he suggested that RCU should have a self checking mechanism to detect these kind of issues.