mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
rcutorture: Convert rcutorture_get_gp_data() to ->gp_seq
SRCU has long used ->srcu_gp_seq, and now RCU uses ->gp_seq. This commit therefore moves the rcutorture_get_gp_data() function from a ->gpnum / ->completed pair to ->gp_seq. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
471f87c3d9
commit
aebc82644b
@ -425,7 +425,7 @@ enum rcutorture_type {
|
|||||||
|
|
||||||
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
|
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
|
||||||
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
||||||
unsigned long *gpnum, unsigned long *completed);
|
unsigned long *gp_seq);
|
||||||
void rcutorture_record_test_transition(void);
|
void rcutorture_record_test_transition(void);
|
||||||
void rcutorture_record_progress(unsigned long vernum);
|
void rcutorture_record_progress(unsigned long vernum);
|
||||||
void do_trace_rcu_torture_read(const char *rcutorturename,
|
void do_trace_rcu_torture_read(const char *rcutorturename,
|
||||||
@ -435,13 +435,10 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
|
|||||||
unsigned long c);
|
unsigned long c);
|
||||||
#else
|
#else
|
||||||
static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
|
static inline void rcutorture_get_gp_data(enum rcutorture_type test_type,
|
||||||
int *flags,
|
int *flags, unsigned long *gp_seq)
|
||||||
unsigned long *gpnum,
|
|
||||||
unsigned long *completed)
|
|
||||||
{
|
{
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
*gpnum = 0;
|
*gp_seq = 0;
|
||||||
*completed = 0;
|
|
||||||
}
|
}
|
||||||
static inline void rcutorture_record_test_transition(void) { }
|
static inline void rcutorture_record_test_transition(void) { }
|
||||||
static inline void rcutorture_record_progress(unsigned long vernum) { }
|
static inline void rcutorture_record_progress(unsigned long vernum) { }
|
||||||
@ -461,21 +458,19 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
|
|||||||
|
|
||||||
static inline void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
static inline void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
||||||
struct srcu_struct *sp, int *flags,
|
struct srcu_struct *sp, int *flags,
|
||||||
unsigned long *gpnum,
|
unsigned long *gp_seq)
|
||||||
unsigned long *completed)
|
|
||||||
{
|
{
|
||||||
if (test_type != SRCU_FLAVOR)
|
if (test_type != SRCU_FLAVOR)
|
||||||
return;
|
return;
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
*completed = sp->srcu_idx;
|
*gp_seq = sp->srcu_idx;
|
||||||
*gpnum = *completed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(CONFIG_TREE_SRCU)
|
#elif defined(CONFIG_TREE_SRCU)
|
||||||
|
|
||||||
void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
||||||
struct srcu_struct *sp, int *flags,
|
struct srcu_struct *sp, int *flags,
|
||||||
unsigned long *gpnum, unsigned long *completed);
|
unsigned long *gp_seq);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1313,18 +1313,16 @@ rcu_torture_stats_print(void)
|
|||||||
if (rtcv_snap == rcu_torture_current_version &&
|
if (rtcv_snap == rcu_torture_current_version &&
|
||||||
rcu_torture_current != NULL) {
|
rcu_torture_current != NULL) {
|
||||||
int __maybe_unused flags = 0;
|
int __maybe_unused flags = 0;
|
||||||
unsigned long __maybe_unused gpnum = 0;
|
unsigned long __maybe_unused gp_seq = 0;
|
||||||
unsigned long __maybe_unused completed = 0;
|
|
||||||
|
|
||||||
rcutorture_get_gp_data(cur_ops->ttype,
|
rcutorture_get_gp_data(cur_ops->ttype,
|
||||||
&flags, &gpnum, &completed);
|
&flags, &gp_seq);
|
||||||
srcutorture_get_gp_data(cur_ops->ttype, srcu_ctlp,
|
srcutorture_get_gp_data(cur_ops->ttype, srcu_ctlp,
|
||||||
&flags, &gpnum, &completed);
|
&flags, &gp_seq);
|
||||||
wtp = READ_ONCE(writer_task);
|
wtp = READ_ONCE(writer_task);
|
||||||
pr_alert("??? Writer stall state %s(%d) g%lu c%lu f%#x ->state %#lx cpu %d\n",
|
pr_alert("??? Writer stall state %s(%d) g%lu f%#x ->state %#lx cpu %d\n",
|
||||||
rcu_torture_writer_state_getname(),
|
rcu_torture_writer_state_getname(),
|
||||||
rcu_torture_writer_state,
|
rcu_torture_writer_state, gp_seq, flags,
|
||||||
gpnum, completed, flags,
|
|
||||||
wtp == NULL ? ~0UL : wtp->state,
|
wtp == NULL ? ~0UL : wtp->state,
|
||||||
wtp == NULL ? -1 : (int)task_cpu(wtp));
|
wtp == NULL ? -1 : (int)task_cpu(wtp));
|
||||||
if (!splatted && wtp) {
|
if (!splatted && wtp) {
|
||||||
@ -1605,8 +1603,7 @@ static void
|
|||||||
rcu_torture_cleanup(void)
|
rcu_torture_cleanup(void)
|
||||||
{
|
{
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
unsigned long gpnum = 0;
|
unsigned long gp_seq = 0;
|
||||||
unsigned long completed = 0;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
rcutorture_record_test_transition();
|
rcutorture_record_test_transition();
|
||||||
@ -1637,11 +1634,10 @@ rcu_torture_cleanup(void)
|
|||||||
fakewriter_tasks = NULL;
|
fakewriter_tasks = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rcutorture_get_gp_data(cur_ops->ttype, &flags, &gpnum, &completed);
|
rcutorture_get_gp_data(cur_ops->ttype, &flags, &gp_seq);
|
||||||
srcutorture_get_gp_data(cur_ops->ttype, srcu_ctlp,
|
srcutorture_get_gp_data(cur_ops->ttype, srcu_ctlp, &flags, &gp_seq);
|
||||||
&flags, &gpnum, &completed);
|
pr_alert("%s: End-test grace-period state: g%lu f%#x\n",
|
||||||
pr_alert("%s: End-test grace-period state: g%lu c%lu f%#x\n",
|
cur_ops->name, gp_seq, flags);
|
||||||
cur_ops->name, gpnum, completed, flags);
|
|
||||||
torture_stop_kthread(rcu_torture_stats, stats_task);
|
torture_stop_kthread(rcu_torture_stats, stats_task);
|
||||||
torture_stop_kthread(rcu_torture_fqs, fqs_task);
|
torture_stop_kthread(rcu_torture_fqs, fqs_task);
|
||||||
for (i = 0; i < ncbflooders; i++)
|
for (i = 0; i < ncbflooders; i++)
|
||||||
|
@ -1249,13 +1249,12 @@ static void process_srcu(struct work_struct *work)
|
|||||||
|
|
||||||
void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
void srcutorture_get_gp_data(enum rcutorture_type test_type,
|
||||||
struct srcu_struct *sp, int *flags,
|
struct srcu_struct *sp, int *flags,
|
||||||
unsigned long *gpnum, unsigned long *completed)
|
unsigned long *gp_seq)
|
||||||
{
|
{
|
||||||
if (test_type != SRCU_FLAVOR)
|
if (test_type != SRCU_FLAVOR)
|
||||||
return;
|
return;
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
*completed = rcu_seq_ctr(sp->srcu_gp_seq);
|
*gp_seq = rcu_seq_current(&sp->srcu_gp_seq);
|
||||||
*gpnum = rcu_seq_ctr(sp->srcu_gp_seq_needed);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(srcutorture_get_gp_data);
|
EXPORT_SYMBOL_GPL(srcutorture_get_gp_data);
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ EXPORT_SYMBOL_GPL(rcutorture_record_test_transition);
|
|||||||
* Send along grace-period-related data for rcutorture diagnostics.
|
* Send along grace-period-related data for rcutorture diagnostics.
|
||||||
*/
|
*/
|
||||||
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
||||||
unsigned long *gpnum, unsigned long *completed)
|
unsigned long *gp_seq)
|
||||||
{
|
{
|
||||||
struct rcu_state *rsp = NULL;
|
struct rcu_state *rsp = NULL;
|
||||||
|
|
||||||
@ -658,8 +658,7 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
|||||||
if (rsp == NULL)
|
if (rsp == NULL)
|
||||||
return;
|
return;
|
||||||
*flags = READ_ONCE(rsp->gp_flags);
|
*flags = READ_ONCE(rsp->gp_flags);
|
||||||
*gpnum = READ_ONCE(rsp->gpnum);
|
*gp_seq = rcu_seq_current(&rsp->gp_seq);
|
||||||
*completed = READ_ONCE(rsp->completed);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
|
EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user