Dear Linux kernel code maintainer,
some weeks ago in the course of a discussion on lkml
and follow-ups) linux kernels of the 2.4 series turned out to sometime
lock up after 497.1 days of uptime, when the "jiffies" variable wraps
back to zero.
Checking the kernel code, I found a number of places where jiffies
were compared in a way that seems to break when they wrap. For these,
I made up patches to use the macros "time_before()" or "time_after()"
that are supposed to handle wraparound correctly.
For a small part of the patches, I believe you to be the relevant kernel code
maintainer. Appended to this email you will find some lines explaining
why I decided to mail or cc: you on this (an extract of the copyright notice
or the MAINTAINERS file), followed by the patch itself. If I mailed you
in error, please drop me a short note.
I kindly ask you to approve the correctness of the patch, and pass it on to
the relevant people for inclusion into the mainline kernel.
Tim Schmielau (email@example.com)
P: Ralf Baechle
--- linux-2.4.18-pre1/arch/mips/baget/vacserial.c Sun Sep 9 19:43:01 2001
+++ linux-2.4.18-pre1-jiffies64/arch/mips/baget/vacserial.c Fri Dec 28
@@ -1785,7 +1785,7 @@
- if (timeout && ((orig_jiffies + timeout) < jiffies))
+ if (timeout && time_after(jiffies, orig_jiffies + timeout))
current->state = TASK_RUNNING;