From mboxrd@z Thu Jan 1 00:00:00 1970 From: haojian.zhuang@gmail.com (Haojian Zhuang) Date: Wed, 27 Apr 2011 14:29:17 +0800 Subject: Enabling tickless kernel feature in ARM In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Apr 27, 2011 at 11:04 AM, Vikram Narayanan wrote: > Dear Haojian, > > On Tue, Apr 26, 2011 at 10:04 PM, Haojian Zhuang > wrote: >> >> On Tue, Apr 26, 2011 at 9:55 PM, Vikram Narayanan wrote: >> > Hi, >> > >> > I want to enable the dynamic tick aka tickless kernel feature for the >> > BSP which I am developing. What are all the architecture dependent >> > changes that needs to be done for implementing it. >> > There was one struct by the name dyn_tick_timer, which is located >> > under linux/include/asm-arm/mach/time.h file. (which is removed from v >> > 2.6.27) >> > Now my question is that, are all the dyn_tick_timer functionalities >> > are moved to a generic interface somewhere? >> CONFIG_NO_HZ is used instead. > > I am aware of the CONFIG_NO_HZ option. I am asking about the > implementation of it. To put in a more clear way. > There was a structure in the kernel source > linux/include/asm-arm/mach/time.h before 2.6.27 > > struct dyn_tick_timer { > ? ? ? ? ?spinlock_t ? ? ?lock; > ? ? ? ? ?unsigned int ? ?state; ? ? ? ? ? ? ? ? ?/* Current state */ > ? ? ? ? ?int ? ? ? ? ? ? (*enable)(void); ? ? ? ?/* Enables dynamic tick */ > ? ? ? ? ?int ? ? ? ? ? ? (*disable)(void); ? ? ? /* Disables dynamic tick */ > ? ? ? ? ?void ? ? ? ? ? ?(*reprogram)(unsigned long); /* Reprograms > the timer */ > ? ? ? ? ?int ? ? ? ? ? ? (*handler)(int, void *); > ?}; > > To enable dynamic tick timer, one should implement functions for > enable, disable and reprogram. But this structure is no more used in > the new kernel source. In 2007 linux symposium, 3 authors talked about > implementing the tickless feature using HPET timers. Now my question > where does the implementation lies in the ARM architecture. > irq_exit(). While irq handler is finished, timer interrupt should also occur. And jiffies may not sync to latest ticks. The process flow is in below. asm_do_IRQ() --> irq_exit() --> tick_nohz_stop_sched_tick() --> tick_do_update_jiffies64() In tick_do_update_jiffies64(), jiffies will be updated whatever the idle time is 1 jiffies or more. >> >> > Are the clock source and clockevent device timers enough to take care >> > of the tickless feature? >> There's no relationship between NOHZ and clocksource/clockevent. >> > >> > - >> > Vikram >> > >> > _______________________________________________ >> > Kernelnewbies mailing list >> > Kernelnewbies at kernelnewbies.org >> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> > >