Re: 2.6.10-rc3: kswapd eats CPU on start of memory-eating task

From: Con Kolivas
Date: Mon Dec 20 2004 - 04:04:50 EST


Con Kolivas wrote:
Logistically what makes sense is if a timeout of 0 is used as a test that completely disables it (avoids another sysctl too). In time for 2.6.10 we should disable it by default until the regressions are better understood. Tuning it into a useful "on" position can happen later and I suspect requires more code.

This patch should have the desired effect.

Con Index: linux-2.6.10-rc3/mm/rmap.c
===================================================================
--- linux-2.6.10-rc3.orig/mm/rmap.c 2004-12-06 13:14:01.000000000 +1100
+++ linux-2.6.10-rc3/mm/rmap.c 2004-12-20 19:54:42.416058897 +1100
@@ -395,6 +395,9 @@ int page_referenced(struct page *page, i
{
int referenced = 0;

+ if (!swap_token_default_timeout)
+ ignore_token = 1;
+
if (page_test_and_clear_young(page))
referenced++;

Index: linux-2.6.10-rc3/mm/thrash.c
===================================================================
--- linux-2.6.10-rc3.orig/mm/thrash.c 2004-12-06 13:14:01.000000000 +1100
+++ linux-2.6.10-rc3/mm/thrash.c 2004-12-20 19:56:01.594602700 +1100
@@ -19,7 +19,10 @@ 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;

/*

Attachment: signature.asc
Description: OpenPGP digital signature