@@ -590,8 +590,8 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
#endif
static inline void rcu_gp_set_torture_wait(int duration) { }
#endif
-unsigned long rcutorture_gather_gp_seqs(void);
-void rcutorture_format_gp_seqs(unsigned long seqs, char *cp);
+unsigned long long rcutorture_gather_gp_seqs(void);
+void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp);
#ifdef CONFIG_TINY_SRCU
@@ -273,8 +273,8 @@ struct rt_read_seg {
bool rt_preempted;
int rt_cpu;
int rt_end_cpu;
- unsigned long rt_gp_seq;
- unsigned long rt_gp_seq_end;
+ unsigned long long rt_gp_seq;
+ unsigned long long rt_gp_seq_end;
};
static int err_segs_recorded;
static struct rt_read_seg err_segs[RCUTORTURE_RDR_MAX_SEGS];
@@ -409,8 +409,8 @@ struct rcu_torture_ops {
void (*gp_slow_register)(atomic_t *rgssp);
void (*gp_slow_unregister)(atomic_t *rgssp);
bool (*reader_blocked)(void);
- unsigned long (*gather_gp_seqs)(void);
- void (*format_gp_seqs)(unsigned long seqs, char *cp);
+ unsigned long long (*gather_gp_seqs)(void);
+ void (*format_gp_seqs)(unsigned long long seqs, char *cp);
long cbflood_max;
int irq_capable;
int can_boost;
@@ -3678,8 +3678,8 @@ rcu_torture_cleanup(void)
}
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_GP) &&
cur_ops->gather_gp_seqs && cur_ops->format_gp_seqs) {
- char buf1[16+1];
- char buf2[16+1];
+ char buf1[20+1];
+ char buf2[20+1];
char sepchar = '-';
cur_ops->format_gp_seqs(err_segs[i].rt_gp_seq, buf1);
@@ -258,15 +258,15 @@ EXPORT_SYMBOL_GPL(kvfree_call_rcu);
#endif
#if IS_ENABLED(CONFIG_RCU_TORTURE_TEST)
-unsigned long rcutorture_gather_gp_seqs(void)
+unsigned long long rcutorture_gather_gp_seqs(void)
{
- return READ_ONCE(rcu_ctrlblk.gp_seq) & 0xff;
+ return READ_ONCE(rcu_ctrlblk.gp_seq) & 0xffffULL;
}
EXPORT_SYMBOL_GPL(rcutorture_gather_gp_seqs);
-void rcutorture_format_gp_seqs(unsigned long seqs, char *cp)
+void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp)
{
- snprintf(cp, 8, "g%02lx", seqs & 0xff);
+ snprintf(cp, 8, "g%04llx", seqs & 0xffffULL);
}
EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs);
#endif
@@ -539,22 +539,22 @@ void rcutorture_get_gp_data(int *flags, unsigned long *gp_seq)
EXPORT_SYMBOL_GPL(rcutorture_get_gp_data);
/* Gather grace-period sequence numbers for rcutorture diagnostics. */
-unsigned long rcutorture_gather_gp_seqs(void)
+unsigned long long rcutorture_gather_gp_seqs(void)
{
- return ((READ_ONCE(rcu_state.gp_seq) & 0xff) << 16) |
- ((READ_ONCE(rcu_state.expedited_sequence) & 0xff) << 8) |
- (READ_ONCE(rcu_state.gp_seq_polled) & 0xff);
+ return ((READ_ONCE(rcu_state.gp_seq) & 0xffffULL) << 40) |
+ ((READ_ONCE(rcu_state.expedited_sequence) & 0xffffffULL) << 16) |
+ (READ_ONCE(rcu_state.gp_seq_polled) & 0xffffULL);
}
EXPORT_SYMBOL_GPL(rcutorture_gather_gp_seqs);
/* Format grace-period sequence numbers for rcutorture diagnostics. */
-void rcutorture_format_gp_seqs(unsigned long seqs, char *cp)
+void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp)
{
- unsigned int egp = (seqs >> 8) & 0xff;
- unsigned int ggp = (seqs >> 16) & 0xff;
- unsigned int pgp = seqs & 0xff;
+ unsigned int egp = (seqs >> 16) & 0xffffffULL;
+ unsigned int ggp = (seqs >> 40) & 0xffffULL;
+ unsigned int pgp = seqs & 0xffffULL;
- snprintf(cp, 16, "g%02x:e%02x:p%02x", ggp, egp, pgp);
+ snprintf(cp, 20, "g%04x:e%06x:p%04x", ggp, egp, pgp);
}
EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs);