mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
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 <kosaki.motohiro@jp.fujitsu.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com> Cc: Paul Jackson <pj@sgi.com> Cc: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d9d4fcfe51
commit
10ed273f50
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
#include <linux/swap.h>
|
#include <linux/swap.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
|
#include <linux/jiffies.h>
|
||||||
#include <linux/bootmem.h>
|
#include <linux/bootmem.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
@ -1276,7 +1277,7 @@ static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags)
|
||||||
if (!zlc)
|
if (!zlc)
|
||||||
return NULL;
|
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);
|
bitmap_zero(zlc->fullzones, MAX_ZONES_PER_ZONELIST);
|
||||||
zlc->last_full_zap = jiffies;
|
zlc->last_full_zap = jiffies;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue