I just wanted to understand the timer patch in timer.c.
It has already been merged in linux mainline kernel
It says that
I did not understand how it calcuates expires_limit as 0x20000000e from given value of expires=0xffffe6f5 and slack=25.
Any help will be apreciable.
E.g. with: expires = 0xffffe6f5 and slack = 25, we get:
expires_limit = 0x20000000e
bit = 33
mask = (1 << 33) - 1 /* undefined */
It calculates expires_limit from the function apply_stack.
static inline`enter code here`
unsigned long apply_slack(struct timer_list *timer, unsigned long expires)
{
unsigned long expires_limit, mask;
int bit;
if (timer->slack >= 0) {`enter code here`
expires_limit = expires + timer->slack;
} else {
long delta = expires - jiffies;
if (delta < 256)
return expires;
expires_limit = expires + delta / 256;
}
mask = expires ^ expires_limit;
if (mask == 0)
return expires;
bit = find_last_bit(&mask, BITS_PER_LONG);
mask = (1 << bit) - 1;
expires_limit = expires_limit & ~(mask);
return expires_limit;
}
I am unable to understand how expires_limit = 0x20000000e??
Any help will be appreciated .
Thanks,