From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbcGVWy6 (ORCPT ); Fri, 22 Jul 2016 18:54:58 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:54646 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbcGVWy5 (ORCPT ); Fri, 22 Jul 2016 18:54:57 -0400 MIME-Version: 1.0 In-Reply-To: References: <20160704093956.299369787@linutronix.de> <20160704094342.189813118@linutronix.de> From: "Jason A. Donenfeld" Date: Sat, 23 Jul 2016 00:54:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 4 15/22] timer: Remove slack leftovers To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Zijlstra , Paul McKenney , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de, Rik van Riel , George Spelvin , Len Brown , Josh Triplett , Eric Dumazet Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 22, 2016 at 5:18 PM, Jason A. Donenfeld wrote: > Hi Thomas, > > On Fri, Jul 22, 2016 at 3:04 PM, Thomas Gleixner 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