lkml.org 
[lkml]   [2014]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subject[Query] tick-oneshot: Why do we need to disable interrupts for reading tick_cpu_device.mode
From
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


\
 
 \ /
  Last update: 2014-04-07 14:41    [W:0.082 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site