From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756287Ab0EYTQD (ORCPT ); Tue, 25 May 2010 15:16:03 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:54978 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024Ab0EYTQA (ORCPT ); Tue, 25 May 2010 15:16:00 -0400 Date: Tue, 25 May 2010 12:12:52 -0700 (PDT) From: Linus Torvalds To: linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, arjan@linux.intel.com, tglx@linutronix.de cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:timers/urgent] timers: Fix slack calculation really In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 May 2010, tip-bot for Thomas Gleixner wrote: > { > - unsigned long expires_limit, mask; > + unsigned long expires_limit, mask, now; > int bit; > > expires_limit = expires; > > - if (timer->slack > -1) > + if (timer->slack >= 0) { > expires_limit = expires + timer->slack; > - else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */ > - expires_limit = expires + (expires - jiffies)/256; > - > + } else { > + now = jiffies; So this works, but I'd really suggest that you actually nest the declarations correctly too. Linus