[Query] tick-oneshot: Why do we need to disable interrupts for reading tick_cpu_device.mode

From: Viresh Kumar
Date: Mon Apr 07 2014 - 07:58:59 EST


Hi Thomas,

I found this piece of code in tick-oneshot.c:

+int tick_oneshot_mode_active(void)
+{
+ unsigned long flags;
+ int ret;
+
+ local_irq_save(flags);
+ ret = __get_cpu_var(tick_cpu_device).mode == TICKDEV_MODE_ONESHOT;
+ local_irq_restore(flags);
+
+ return ret;
+}

Why do we need local_irq_save/restore() here for just reading value
of this variable? Can these be dropped? If yes, I would do that as
part of my cleanup series around tick stuff.

--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/