All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH] 2.6.24-rcx: Make sys_poll() wait at least timeout ms
Date: Tue, 18 Dec 2007 18:01:15 -0600	[thread overview]
Message-ID: <47685F4B.8000207@shaw.ca> (raw)
In-Reply-To: <fa.QbT8/KZb1MTA5+n7SD6kFi6mqso@ifi.uio.no>

Karsten Wiese wrote:
> Hi,
> 
> while playing with jackd on 2.6.24-rcx, I found poll() timing out too early.
> That is: earlier than its timeout argument specified.
> Setting poll()'s timeout argument to "required timeout" + "1 jiffy in ms"
> fixed it. Patch below should fix it too. Correct?
> Untested.
> Otherwise 2.6.24-rc5 ticks just fine here, thanks.
> 
>       Karsten
>  
> ------------->
> Make sys_poll() wait at least timeout ms
> 
> schedule_timeout(jiffies) waits for at least jiffies - 1.
> Add 1 jiffie to the timeout_jiffies calculated in sys_poll() to wait at least
> timeout_msecs, like poll() manpage says.
> 
> Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
> ---
>  fs/select.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/select.c b/fs/select.c
> index 47f4792..5633fe9 100644
> --- a/fs/select.c
> +++ b/fs/select.c
> @@ -739,7 +739,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
>  			timeout_jiffies = -1;
>  		else
>  #endif
> -			timeout_jiffies = msecs_to_jiffies(timeout_msecs);
> +			timeout_jiffies = msecs_to_jiffies(timeout_msecs) + 1;
>  	} else {
>  		/* Infinite (< 0) or no (0) timeout */
>  		timeout_jiffies = timeout_msecs;

That seems fishy. What is your value of HZ and what is the timeout value 
that was passed in the bad case?

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


       reply	other threads:[~2007-12-19  0:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.QbT8/KZb1MTA5+n7SD6kFi6mqso@ifi.uio.no>
2007-12-19  0:01 ` Robert Hancock [this message]
2007-12-19  1:06   ` [RFC/PATCH] 2.6.24-rcx: Make sys_poll() wait at least timeout ms Karsten Wiese
2007-12-19  2:29     ` Robert Hancock
2007-12-19 12:55       ` Karsten Wiese
2007-12-18 17:31 Karsten Wiese

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=47685F4B.8000207@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=fzu@wemgehoertderstaat.de \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.