~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to kernel/rcutorture.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include <linux/srcu.h>
48
48
#include <linux/slab.h>
49
49
#include <asm/byteorder.h>
50
 
#include <linux/sched.h>
51
50
 
52
51
MODULE_LICENSE("GPL");
53
52
MODULE_AUTHOR("Paul E. McKenney <paulmck@us.ibm.com> and "
132
131
 
133
132
static LIST_HEAD(rcu_torture_freelist);
134
133
static struct rcu_torture __rcu *rcu_torture_current;
135
 
static long rcu_torture_current_version;
 
134
static unsigned long rcu_torture_current_version;
136
135
static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
137
136
static DEFINE_SPINLOCK(rcu_torture_lock);
138
137
static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) =
147
146
static atomic_t n_rcu_torture_error;
148
147
static long n_rcu_torture_boost_ktrerror;
149
148
static long n_rcu_torture_boost_rterror;
150
 
static long n_rcu_torture_boost_allocerror;
151
 
static long n_rcu_torture_boost_afferror;
152
149
static long n_rcu_torture_boost_failure;
153
150
static long n_rcu_torture_boosts;
154
151
static long n_rcu_torture_timers;
164
161
#endif
165
162
int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
166
163
 
167
 
#ifdef CONFIG_RCU_BOOST
 
164
#if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU)
168
165
#define rcu_can_boost() 1
169
 
#else /* #ifdef CONFIG_RCU_BOOST */
 
166
#else /* #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU) */
170
167
#define rcu_can_boost() 0
171
 
#endif /* #else #ifdef CONFIG_RCU_BOOST */
 
168
#endif /* #else #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU) */
172
169
 
173
170
static unsigned long boost_starttime;   /* jiffies of next boost test start. */
174
171
DEFINE_MUTEX(boost_mutex);              /* protect setting boost_starttime */
752
749
                n_rcu_torture_boost_rterror++;
753
750
        }
754
751
 
 
752
        init_rcu_head_on_stack(&rbi.rcu);
755
753
        /* Each pass through the following loop does one boost-test cycle. */
756
754
        do {
757
755
                /* Wait for the next test interval. */
811
809
 
812
810
        /* Clean up and exit. */
813
811
        VERBOSE_PRINTK_STRING("rcu_torture_boost task stopping");
 
812
        destroy_rcu_head_on_stack(&rbi.rcu);
814
813
        rcutorture_shutdown_absorb("rcu_torture_boost");
815
814
        while (!kthread_should_stop() || rbi.inflight)
816
815
                schedule_timeout_uninterruptible(1);
887
886
                        old_rp->rtort_pipe_count++;
888
887
                        cur_ops->deferred_free(old_rp);
889
888
                }
890
 
                rcu_torture_current_version++;
 
889
                rcutorture_record_progress(++rcu_torture_current_version);
891
890
                oldbatch = cur_ops->completed();
892
891
                rcu_stutter_wait("rcu_torture_writer");
893
892
        } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
1067
1066
        }
1068
1067
        cnt += sprintf(&page[cnt], "%s%s ", torture_type, TORTURE_FLAG);
1069
1068
        cnt += sprintf(&page[cnt],
1070
 
                       "rtc: %p ver: %ld tfle: %d rta: %d rtaf: %d rtf: %d "
1071
 
                       "rtmbe: %d rtbke: %ld rtbre: %ld rtbae: %ld rtbafe: %ld "
 
1069
                       "rtc: %p ver: %lu tfle: %d rta: %d rtaf: %d rtf: %d "
 
1070
                       "rtmbe: %d rtbke: %ld rtbre: %ld "
1072
1071
                       "rtbf: %ld rtb: %ld nt: %ld",
1073
1072
                       rcu_torture_current,
1074
1073
                       rcu_torture_current_version,
1079
1078
                       atomic_read(&n_rcu_torture_mberror),
1080
1079
                       n_rcu_torture_boost_ktrerror,
1081
1080
                       n_rcu_torture_boost_rterror,
1082
 
                       n_rcu_torture_boost_allocerror,
1083
 
                       n_rcu_torture_boost_afferror,
1084
1081
                       n_rcu_torture_boost_failure,
1085
1082
                       n_rcu_torture_boosts,
1086
1083
                       n_rcu_torture_timers);
1087
1084
        if (atomic_read(&n_rcu_torture_mberror) != 0 ||
1088
1085
            n_rcu_torture_boost_ktrerror != 0 ||
1089
1086
            n_rcu_torture_boost_rterror != 0 ||
1090
 
            n_rcu_torture_boost_allocerror != 0 ||
1091
 
            n_rcu_torture_boost_afferror != 0 ||
1092
1087
            n_rcu_torture_boost_failure != 0)
1093
1088
                cnt += sprintf(&page[cnt], " !!!");
1094
1089
        cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG);
1332
1327
        int i;
1333
1328
 
1334
1329
        mutex_lock(&fullstop_mutex);
 
1330
        rcutorture_record_test_transition();
1335
1331
        if (fullstop == FULLSTOP_SHUTDOWN) {
1336
1332
                printk(KERN_WARNING /* but going down anyway, so... */
1337
1333
                       "Concurrent 'rmmod rcutorture' and shutdown illegal!\n");
1487
1483
        atomic_set(&n_rcu_torture_error, 0);
1488
1484
        n_rcu_torture_boost_ktrerror = 0;
1489
1485
        n_rcu_torture_boost_rterror = 0;
1490
 
        n_rcu_torture_boost_allocerror = 0;
1491
 
        n_rcu_torture_boost_afferror = 0;
1492
1486
        n_rcu_torture_boost_failure = 0;
1493
1487
        n_rcu_torture_boosts = 0;
1494
1488
        for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
1625
1619
                }
1626
1620
        }
1627
1621
        register_reboot_notifier(&rcutorture_shutdown_nb);
 
1622
        rcutorture_record_test_transition();
1628
1623
        mutex_unlock(&fullstop_mutex);
1629
1624
        return 0;
1630
1625