All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for sys_nanosleep() in 2.4.16
@ 2001-11-29  6:56 Michael Arras
  2001-11-29 10:04 ` Christoph Hellwig
  2001-11-29 23:41 ` george anzinger
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Arras @ 2001-11-29  6:56 UTC (permalink / raw)
  To: linux-kernel

Greetings,

For many of us, the kernel thread scheduling resolution is
10ms (see getitimer(2)).  By adding 1 jiffy to the time to
sleep in sys_nanosleep(), threads are sleeping 10ms too long.
timespec_to_jiffies() does a good job at returning the
appropriate number of jiffies to sleep.  There is no need to
add one for good measure.

Mike Arras
mkarras110@yahoo.com

diff -urN linux-2.4.16/kernel/timer.c linux/kernel/timer.c
--- linux-2.4.16/kernel/timer.c Mon Oct  8 13:41:41 2001
+++ linux/kernel/timer.c        Wed Nov 28 00:23:15 2001
@@ -825,7 +825,7 @@
                return 0;
        }
 
-       expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
+       expire = timespec_to_jiffies(&t);
 
        current->state = TASK_INTERRUPTIBLE;
        expire = schedule_timeout(expire);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-29 23:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-29  6:56 [PATCH] Fix for sys_nanosleep() in 2.4.16 Michael Arras
2001-11-29 10:04 ` Christoph Hellwig
2001-11-29 23:41 ` george anzinger

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.