Is there a problem in timeval_to_jiffies?
From: Henry Margies (henry.margies_at_gmx.de)
Date: 09/09/04
- Previous message: Nick Piggin: "Re: Q about pagecache data never written to disk"
- Next in thread: Henry Margies: "Re: Is there a problem in timeval_to_jiffies?"
- Reply: Henry Margies: "Re: Is there a problem in timeval_to_jiffies?"
- Maybe reply: George Anzinger: "Re: Is there a problem in timeval_to_jiffies?"
- Maybe reply: Andi Kleen: "Re: Is there a problem in timeval_to_jiffies?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 9 Sep 2004 15:48:28 +0200 To: linux-kernel@vger.kernel.org
Hallo.
I'm working on an arm based embedded device running kernel 2.6.9.
I asked this question also on the arm mailing list, but nobody
could answer me my questions there, so I will try here :)
I have some problems with itimers. For example, if I set up a
timer using a period of 20ms, the system needs 30ms to send the
signal. I figured out, that it needs always 10ms more than I
want.
The problem seems to be located in the timeval_to_jiffies()
function.
In function do_setitimer() the following calculation is done:
i = timeval_to_jiffies(&value->it_interval);
... where i is the interval for my timer. The problem is, that
for it_interval = 0 seconds and 20000 microseconds, i = 3. But
shouldn't it be 2? It looks like, the problem is somewhere in
here (timeval_to_jiffies()):
return (((u64)sec * SEC_CONVERSION) +
(((u64)usec * USEC_CONVERSION + USEC_ROUND) >>
(USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >>
SEC_JIFFIE_SC;
I don't understand all of the formula in detail. But for me, it
looks like the problem is in USEC_ROUND.
Any ideas?
Thx in advance,
Henry
-- Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Nick Piggin: "Re: Q about pagecache data never written to disk"
- Next in thread: Henry Margies: "Re: Is there a problem in timeval_to_jiffies?"
- Reply: Henry Margies: "Re: Is there a problem in timeval_to_jiffies?"
- Maybe reply: George Anzinger: "Re: Is there a problem in timeval_to_jiffies?"
- Maybe reply: Andi Kleen: "Re: Is there a problem in timeval_to_jiffies?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|