Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1448819
| From | "Jason A. Donenfeld" <Jason@zx2c4.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [patch 4 15/22] timer: Remove slack leftovers |
| Date | 2016-07-23 01:00 +0200 |
| Message-ID | <rXRAe-3sk-25@gated-at.bofh.it> (permalink) |
| References | <rR8Pv-419-7@gated-at.bofh.it> <rR8Pv-419-27@gated-at.bofh.it> <rXGYa-5de-7@gated-at.bofh.it> <rXInf-6hr-1@gated-at.bofh.it> <rXKp3-7uV-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jul 22, 2016 at 5:18 PM, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Hi Thomas,
>
> On Fri, Jul 22, 2016 at 3:04 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> Well, this really depends on the TIMEOUT value you have. The code now does
>> implicit batching for larger timeouts by queueing the timers into wheels with
>> coarse grained granularity. As long as your new TIMEOUT value ends up in the
>> same bucket then that's equivalent to the slack thing.
>>
>> Can you give me a ballpark of your TIMEOUT value?
>
> Generally either 5 seconds, 10 seconds, or 25 seconds.
>
> Are these okay? Is the 25 case substantially different from the 5 case?
I suppose, anyway, it's easy enough just to provide my own coalescing
function. Actually, I'd rather have it batch timers to fire earlier
rather than later, in my case. So, I can do something like this to
round down to the nearest ~ quarter of a second:
static inline unsigned long slack_time(unsigned long time)
{
return time & ~(BIT_MASK(ilog2(HZ / 4) + 1) - 1);
}
mod_timer(&timer, slack_time(jiffies + TIMEOUT));
This seems to do roughly what I want.
Jason
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [patch 4 15/22] timer: Remove slack leftovers "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-07-22 13:40 +0200
Re: [patch 4 15/22] timer: Remove slack leftovers Thomas Gleixner <tglx@linutronix.de> - 2016-07-22 15:10 +0200
Re: [patch 4 15/22] timer: Remove slack leftovers "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-07-22 17:20 +0200
Re: [patch 4 15/22] timer: Remove slack leftovers "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-07-23 01:00 +0200
csiph-web