mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Chua <jeff.chua.linux@gmail.com>
To: Johannes Berg <johannes.berg@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	"johnstul@us.ibm.com" <johnstul@us.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Intel Linux Wireless <ilw@linux.intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Frans Pop <elendil@planet.nl>,
	"Chatre, Reinette" <reinette.chatre@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: Wireless IBSS on Linux-2.6.34 broken by commit 3bbb9ec946428b96657126768f65487a48dd090c
Date: Mon, 24 May 2010 07:16:24 +0800 (SGT)	[thread overview]
Message-ID: <Pine.LNX.4.64.1005240710460.3159@boston.corp.fedex.com> (raw)


Mon, May 24, 2010 at 5:25 AM, Arjan van de Ven <arjan@linux.intel.com> 
wrote:
>>> can you try, instead do the following, in the apply_slack() function:
>>>
>>> just before the return expires_limit; do
>>>
>>> if (expires_limit<  expires)
>>> # # #expires_limit = expires;
>>
>> This doesn't work.
>>
>>
>>> if that does not fix it, a second thought:
>>> add, after the first if (timer->slack<  0)
>>>
>>> if (timer->slack<  0&&  expires<  jiffies)
>>> # # # #expires_limit = expires;
>>
>> This works.
>
> hmm ok so the wireless stack sets a timer way back in the past
> ok that's technically legal.
>
> how about
>
> expires_limit = expires;
>
> if (timer->slack > -1)
>        expires_limit = expires + timer->slack;
> else if (time_after(expires, jiffies))
>        expires_limit = expires + (expires - jiffies)/256;
>
> can you test such a thing and send a patch?
> (it has my Acked-By: either way)


Arjan,

Tested and working. Here's the patch. Thanks for the fix!

Jeff



--- a/kernel/timer.c.org	2010-05-24 07:09:04.000000000 +0800
+++ a/kernel/timer.c	2010-05-24 07:05:22.000000000 +0800
@@ -750,9 +750,11 @@
  	unsigned long expires_limit, mask;
  	int bit;

-	expires_limit = expires + timer->slack;
+	expires_limit = expires;

-	if (timer->slack < 0) /* auto slack: use 0.4% */
+	if (timer->slack > -1)
+		expires_limit = expires + timer->slack;
+	else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
  		expires_limit = expires + (expires - jiffies)/256;

  	mask = expires ^ expires_limit;



             reply	other threads:[~2010-05-23 23:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-23 23:16 Jeff Chua [this message]
2010-05-24 14:57 ` Linus Torvalds
2010-05-25 18:37   ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 22:48 Jeff Chua
2010-05-23 17:07 Jeff Chua
2010-05-23  4:58 Jeff Chua
2010-05-23  6:21 ` Arjan van de Ven
2010-05-23  9:49 ` Johannes Berg
2010-05-23 13:19   ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1005240710460.3159@boston.corp.fedex.com \
    --to=jeff.chua.linux@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=elendil@planet.nl \
    --cc=ilw@linux.intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mingo@elte.hu \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®