lkml.org 
[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH tip/core/rcu 41/47] rcu: Trace only after NULL-pointer check
    Date
    From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

    Fix a bonehead error introduced when adding event tracing to rcutorture.
    Move the traces to follow the NULL-pointer checks.

    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    ---
    kernel/rcutorture.c | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
    index c27862b..fdac008 100644
    --- a/kernel/rcutorture.c
    +++ b/kernel/rcutorture.c
    @@ -1000,12 +1000,12 @@ static void rcu_torture_timer(unsigned long unused)
    rcu_read_lock_bh_held() ||
    rcu_read_lock_sched_held() ||
    srcu_read_lock_held(&srcu_ctl));
    - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu);
    if (p == NULL) {
    /* Leave because rcu_torture_writer is not yet underway */
    cur_ops->readunlock(idx);
    return;
    }
    + do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu);
    if (p->rtort_mbtest == 0)
    atomic_inc(&n_rcu_torture_mberror);
    spin_lock(&rand_lock);
    @@ -1063,13 +1063,13 @@ rcu_torture_reader(void *arg)
    rcu_read_lock_bh_held() ||
    rcu_read_lock_sched_held() ||
    srcu_read_lock_held(&srcu_ctl));
    - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu);
    if (p == NULL) {
    /* Wait for rcu_torture_writer to get underway */
    cur_ops->readunlock(idx);
    schedule_timeout_interruptible(HZ);
    continue;
    }
    + do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu);
    if (p->rtort_mbtest == 0)
    atomic_inc(&n_rcu_torture_mberror);
    cur_ops->read_delay(&rand);
    --
    1.7.8


    \
     
     \ /
      Last update: 2012-02-04 02:51    [W:4.025 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site