[lkml]   [2009]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: Reduce the default HZ value
Alan Cox wrote:
> jiffies is *really* expensive...


> However you don't need HZ

Thus I said "libata would be happy to use milliseconds rather than
jiffies; the unit does not matter."

All crucial constants and variables are already in useful units, and we
are forced to convert them to jiffies, and test against 'jiffies' global
var, because the API does not provide other reasonable alternatives.

Pretty much all users of time -- including users of timers -- are forced
to convert from a useful unit of time to jiffies, because that's what
the API requires.

> and you can do that really easily by making your timer switch a single
> value to the correct state for the time and in your loops just checking
> while ( ap->reset_state == WIBBLING_RANDOMLY) {
> wobble = readl(ap->ioaddr.wibble);
> mdelay(1);
> if (wobble & WIBBLED) {
> ...
> }
> }

And when the deadline changes, you need mod_timer rather than a simple
non-global-variable increment.

And when you consider all the bits of state, spread across not only
libata core __but drivers as well__, a timer-based solution gets even

But you're still missing the point. jiffies are just a unit, a unit
forced upon us by all the time-based kernel API functions that take
jiffies rather than usec or msec.

I would rather fix the API, than investigate hacky solutions that
complicate the code even more.


 \ /
  Last update: 2009-05-07 22:07    [W:0.083 / U:6.696 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site