|
@@ -1097,15 +1097,15 @@ static void add_interrupt_bench(cycles_t start)
|
|
|
static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
|
|
|
{
|
|
|
__u32 *ptr = (__u32 *) regs;
|
|
|
- unsigned long flags;
|
|
|
+ unsigned int idx;
|
|
|
|
|
|
if (regs == NULL)
|
|
|
return 0;
|
|
|
- local_irq_save(flags);
|
|
|
- if (f->reg_idx >= sizeof(struct pt_regs) / sizeof(__u32))
|
|
|
- f->reg_idx = 0;
|
|
|
- ptr += f->reg_idx++;
|
|
|
- local_irq_restore(flags);
|
|
|
+ idx = READ_ONCE(f->reg_idx);
|
|
|
+ if (idx >= sizeof(struct pt_regs) / sizeof(__u32))
|
|
|
+ idx = 0;
|
|
|
+ ptr += idx++;
|
|
|
+ WRITE_ONCE(f->reg_idx, idx);
|
|
|
return *ptr;
|
|
|
}
|
|
|
|