X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Fthrash.c;h=735a91baa6ff3740b9205b95151b602a92a9df6b;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=7183937b24e5dbad6f7b8ad1e104c06b84a82590;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/mm/thrash.c b/mm/thrash.c index 7183937b2..735a91baa 100644 --- a/mm/thrash.c +++ b/mm/thrash.c @@ -13,13 +13,17 @@ #include #include -static spinlock_t swap_token_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(swap_token_lock); static unsigned long swap_token_timeout; unsigned long swap_token_check; struct mm_struct * swap_token_mm = &init_mm; #define SWAP_TOKEN_CHECK_INTERVAL (HZ * 2) -#define SWAP_TOKEN_TIMEOUT (HZ * 300) +#define SWAP_TOKEN_TIMEOUT 0 +/* + * Currently disabled; Needs further code to work at HZ * 300. + */ +unsigned long swap_token_default_timeout = SWAP_TOKEN_TIMEOUT; /* * Take the token away if the process had no page faults @@ -75,10 +79,10 @@ void grab_swap_token(void) if ((reason = should_release_swap_token(mm))) { unsigned long eligible = jiffies; if (reason == SWAP_TOKEN_TIMED_OUT) { - eligible += SWAP_TOKEN_TIMEOUT; + eligible += swap_token_default_timeout; } mm->swap_token_time = eligible; - swap_token_timeout = jiffies + SWAP_TOKEN_TIMEOUT; + swap_token_timeout = jiffies + swap_token_default_timeout; swap_token_mm = current->mm; } spin_unlock(&swap_token_lock);