[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9pc4ihLUmxo7mWmwCKyprXF3M0mmfLt_+is5f_HXNeq+A@mail.gmail.com>
Date: Sat, 23 Jul 2016 00:54:48 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Paul McKenney <paulmck@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Chris Mason <clm@...com>,
Arjan van de Ven <arjan@...radead.org>, rt@...utronix.de,
Rik van Riel <riel@...hat.com>,
George Spelvin <linux@...encehorizons.net>,
Len Brown <lenb@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [patch 4 15/22] timer: Remove slack leftovers
On Fri, Jul 22, 2016 at 5:18 PM, Jason A. Donenfeld <Jason@...c4.com> wrote:
> Hi Thomas,
>
> On Fri, Jul 22, 2016 at 3:04 PM, Thomas Gleixner <tglx@...utronix.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
Powered by blists - more mailing lists