Fix for sys_nanosleep() in 2.4.16

Fix for sys_nanosleep() in 2.4.16

Post by Michael Arra » Fri, 30 Nov 2001 16:00:12



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

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

                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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Patch: Fix serial module use count (2.4.16 _and_ 2.5)

You don't call rs_open.  The tty layer does that for you.  The tty layer
also cleans up on close by calling the driver specific close function.

Yes I agree with you that it might not, but that is a 2.5 kernel issue,
not a 2.4 "lets do a massive change" issue.  The tty layer is complex
and messy, and we shouldn't go around randomly changing it in 2.4.

Ok, so you're poking around in kernel code calling kernel functions that
were previously declared static and not visible to anything but the tty
layer.  That immediately makes your example invalid because you're not
following the rules that the tty layers lays down for opening tty devices.

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. reading beyond end of device

3. 2.4.16 Fix NULL pointer dereferencing in agpgart_be.c

4. what's the difference between pr_common with pr_pcommon?

5. 2.4.16 not loading SCSI module

6. MOO-TIFF linking ?

7. oops with kjournald in SMP 2.4.16

8. Modem problem

9. settings differ from 2.2.17 to 2.4.16

10. 2.4.16

11. Bad EIP value on 2.4.16

12. 2.4.16 PPC [Success]

13. Problems with 3ware 3dm and 2.4.16...