From: KOSAKI Motohiro Date: Tue, 4 Mar 2008 22:28:32 +0000 (-0800) Subject: zlc_setup(): handle jiffies wraparound X-Git-Tag: v2.6.25-rc4~78 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=10ed273f5016c582413dfbc468dd084957d847e1;p=linux-2.6-omap-h63xx.git zlc_setup(): handle jiffies wraparound jiffies subtraction may cause an overflow problem. It should be using time_after(). [akpm@linux-foundation.org: include jiffies.h] Signed-off-by: KOSAKI Motohiro Cc: Lee Schermerhorn Cc: Paul Jackson Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8896e874a67..e76cf94725c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1276,7 +1277,7 @@ static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags) if (!zlc) return NULL; - if (jiffies - zlc->last_full_zap > 1 * HZ) { + if (time_after(jiffies, zlc->last_full_zap + HZ)) { bitmap_zero(zlc->fullzones, MAX_ZONES_PER_ZONELIST); zlc->last_full_zap = jiffies; }