Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Kernel Tick: (19 Items)
   
Kernel Tick  
Hi all, 
Does the Kernel supports variable tick ? 

Meaning, on a system with 1ms tick resolution, if the system can go to 4ms idle, will the tick size be modified to 4ms ?
 if not - system can never be idle more then 1ms..it will wake up just to figure out it can go to sleep again..not 
optimized for power consumption 

Any Ideas ? 

Thanks,
Ran 
RE: Kernel Tick  
We call it "tickless operation". And yes, the kernel figures out when the next timer interrupt must be and arragnes to 
inhibit tick interrupts until then. 


-----Original Message-----
From: ran wainstein [mailto:community-noreply@qnx.com]
Sent: Wed 2011-04-20 11:45
To: ostech-core_os
Subject: Kernel Tick
 
Hi all, 
Does the Kernel supports variable tick ? 

Meaning, on a system with 1ms tick resolution, if the system can go to 4ms idle, will the tick size be modified to 4ms ?
 if not - system can never be idle more then 1ms..it will wake up just to figure out it can go to sleep again..not 
optimized for power consumption 

Any Ideas ? 

Thanks,
Ran 



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post85166


Attachment: Text winmail.dat 2.61 KB
Re: RE: Kernel Tick  
Hm... That's interesting...
And if kernel schedules next timer tick for those 4 ms and after that in 500 mks  some other hardware (e.g. disk) 
requests an interrupt and handler of that interrupt schedules event for 1 ms? How can the kernel know what was the time 
value at the moment of disk interrupt to schedule 1 ms delay properly without introducing clock time error? It would not
 be able to align with the next tick since the tick would only come in 3.5 ms.

> We call it "tickless operation". And yes, the kernel figures out when the next
>  timer interrupt must be and arragnes to inhibit tick interrupts until then. 
> 
> 
> -----Original Message-----
> From: ran wainstein [mailto:community-noreply@qnx.com]
> Sent: Wed 2011-04-20 11:45
> To: ostech-core_os
> Subject: Kernel Tick
>  
> Hi all, 
> Does the Kernel supports variable tick ? 
> 
> Meaning, on a system with 1ms tick resolution, if the system can go to 4ms 
> idle, will the tick size be modified to 4ms ? if not - system can never be 
> idle more then 1ms..it will wake up just to figure out it can go to sleep 
> again..not optimized for power consumption 
> 
> Any Ideas ? 
> 
> Thanks,
> Ran 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post85166
> 
> 


RE: RE: Kernel Tick  
When the kernel is running tickless, it's still measuring the passage of time in a hardware counter (just not causing a 
tick interrupt). When the kernel is woken by an interrupt during a tickless interval, it updates its software timers, 
which are essentially tick counter, from the hardware counters.


-----Original Message-----
From: Oleh Derevenko [mailto:community-noreply@qnx.com]
Sent: Wed 2011-04-20 12:49
To: ostech-core_os
Subject: Re: RE: Kernel Tick
 
Hm... That's interesting...
And if kernel schedules next timer tick for those 4 ms and after that in 500 mks  some other hardware (e.g. disk) 
requests an interrupt and handler of that interrupt schedules event for 1 ms? How can the kernel know what was the time 
value at the moment of disk interrupt to schedule 1 ms delay properly without introducing clock time error? It would not
 be able to align with the next tick since the tick would only come in 3.5 ms.

> We call it "tickless operation". And yes, the kernel figures out when the next
>  timer interrupt must be and arragnes to inhibit tick interrupts until then. 
> 
> 
> -----Original Message-----
> From: ran wainstein [mailto:community-noreply@qnx.com]
> Sent: Wed 2011-04-20 11:45
> To: ostech-core_os
> Subject: Kernel Tick
>  
> Hi all, 
> Does the Kernel supports variable tick ? 
> 
> Meaning, on a system with 1ms tick resolution, if the system can go to 4ms 
> idle, will the tick size be modified to 4ms ? if not - system can never be 
> idle more then 1ms..it will wake up just to figure out it can go to sleep 
> again..not optimized for power consumption 
> 
> Any Ideas ? 
> 
> Thanks,
> Ran 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post85166
> 
> 






_______________________________________________

OSTech
http://community.qnx.com/sf/go/post85168


Attachment: Text winmail.dat 3.2 KB
Re: RE: RE: Kernel Tick  
So - how can I set the Kernel to run in "tickles mode" ?

I there any reference you can provide to learn more about this feature ? could not find nothing on this. 

Does it requires different timers call outs ?

What if I hook into Idle() - I've noticed the Idle handler will get the next timer interrupt event as IN param, can I 
still use this hook in a tickles mode ? 

Thanks, 
Ran 
Re: RE: RE: Kernel Tick  
Atilla hi, 
Can you tell me how to enable tickles timer ?

Thanks, 
Ran 
RE: RE: RE: Kernel Tick  
To enable use the -Z option to startup

-----Original Message-----
From: ran wainstein [mailto:community-noreply@qnx.com] 
Sent: April 21, 2011 12:15 PM
To: ostech-core_os
Subject: Re: RE: RE: Kernel Tick

Atilla hi, 
Can you tell me how to enable tickles timer ?

Thanks, 
Ran 



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post85183
Re: RE: RE: RE: Kernel Tick  
BTW this is not available in versions 6.5.0 or earlier
Re: RE: RE: RE: Kernel Tick  
Thanks, 6.5.0 is the latest as far as I know. 

Is there a newer SDP then that ? 


Ran
RE: RE: RE: RE: Kernel Tick  
No, that is the latest.  If you have a service plan you can request a
Priority Support Patch through your QNX contact.

Chris

-----Original Message-----
From: ran wainstein [mailto:community-noreply@qnx.com] 
Sent: April 21, 2011 1:17 PM
To: ostech-core_os
Subject: Re: RE: RE: RE: Kernel Tick

Thanks, 6.5.0 is the latest as far as I know. 

Is there a newer SDP then that ? 


Ran



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post85187
Re: RE: RE: RE: RE: Kernel Tick  
Thanks, service plan is on the way. 

Do you happen to know if there is a patch for "cpu hotplug" ? ( add\remove CPU's on the the fly ? ) 

Is there a list of available patches somewhere ? 

Thanks 
Ran
RE: RE: RE: RE: RE: Kernel Tick  
Never used any hardware that we could enable/disable processors on the
fly...not sure what the smp kernel would do?

BSPs are available:
http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/BSPAndDri
vers

650 patches at:
http://www.qnx.com/download/group.html?programid=20905



-----Original Message-----
From: ran wainstein [mailto:community-noreply@qnx.com] 
Sent: April 21, 2011 2:53 PM
To: ostech-core_os
Subject: Re: RE: RE: RE: RE: Kernel Tick

Thanks, service plan is on the way. 

Do you happen to know if there is a patch for "cpu hotplug" ? (
add\remove CPU's on the the fly ? ) 

Is there a list of available patches somewhere ? 

Thanks 
Ran



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post85191
Re: RE: RE: RE: RE: RE: Kernel Tick  
Thanks.

With all those multi-core embedded devices out there, it would be useful from power perspective to be able to turn on\
off cores when not needed, or even create CPU's partitioning. SMP kernel should migrate processes accordingly. it is 
implemented in Linux.

As for the tickles thing, I'll consult with our QNX rep. , this is a must have feature for power management. 



Ran
Re: Kernel Tick  
Dynamically turning cpus on and off as a funtion of load is implemented in 6.6 for the Playbook platform (arm). We also 

implemented dynamic voltage and frequency scaling. We did both to support power management.

I suspect extending to other platforms would be a matter of CE work. Rather a lot of CE work, I would think.

ran wainstein wrote:
> Thanks.
> 
> With all those multi-core embedded devices out there, it would be useful from power perspective to be able to turn on\
off cores when not needed, or even create CPU's partitioning. SMP kernel should migrate processes accordingly. it is 
implemented in Linux.
> 
> As for the tickles thing, I'll consult with our QNX rep. , this is a must have feature for power management. 
> 
> 
> 
> Ran
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post85195
> 

Re: Kernel Tick  
Thanks, makes sense. 

I can probably handle DFM\DFM in a driver, but for hot plug and tickles I will need Kernel changes. 


But - I do have a question about DFM\DVM : 

Obviously , I will change freq\voltage based on CPU utilization %. What will be the best way to measure cpu util ? 

utilities like hogs and top are nice, but I'm looking for API I can use from my cpu profiler. 

I've ended up implemented this by creating Adaptive Partition ( system , 100% ) , and use the APS API's for getting Idle
 counts, works well, but APS might be overkill for this ? 

Thanks, 
Ran  
Re: Kernel Tick  
The kernel calccualte cpu load (most efficeint place to do it) and uses programmable thesholds to switch between cpu 
speeds. Also handles hysteresis. However, the kernel requires a dll will callouts to actually manipualte the hardware to
 
switch cpu frequencies. Those callouts are platform dependant. We've implemented for the OMAP4430 platform only. Things 

can get very complicated when the different cpu speed cpu states interact with powerstates of other parts of the SOC, 
like DMA controllers, power regulators and clock sources.

ran wainstein wrote:
> Thanks, makes sense. 
> 
> I can probably handle DFM\DFM in a driver, but for hot plug and tickles I will need Kernel changes. 
> 
> 
> But - I do have a question about DFM\DVM : 
> 
> Obviously , I will change freq\voltage based on CPU utilization %. What will be the best way to measure cpu util ? 
> 
> utilities like hogs and top are nice, but I'm looking for API I can use from my cpu profiler. 
> 
> I've ended up implemented this by creating Adaptive Partition ( system , 100% ) , and use the APS API's for getting 
Idle counts, works well, but APS might be overkill for this ? 
> 
> Thanks, 
> Ran  
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post85197
> 

Re: RE: RE: RE: RE: Kernel Tick  
I was incorrect in my statement that you can get new features in a PSP.  It would actually be a Custom Engineering 
request since it would be a back port of a custom feature into a past release.
Re: RE: RE: RE: RE: Kernel Tick  
...CE would not be covered under a support plan.

Chris
Re: RE: RE: RE: RE: Kernel Tick  
Attilla, 

I'm aware of the complication, probably some kind of voting mechanism needed to be implemented before making PM decision
. 

I understand the those features were implemented in 6.6 for RIM's play book, and I can engage QNX and request CE if I 
need them on 6.5, 


Any ideas when 6.6 will be released ? we care about power too :) 

Thanks, 
Ran