Skip to contentSkip to conversation

Linux 2.6.9-ac16

DISCUSSION Chuck Ebbert 3 participants 3 messages Dec 21, 2004 – Dec 22, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Chuck Ebbert

I backported this patch to 2.6.9 but haven't tested it yet. It requires the
'spurious oomkill' patch I posted earlier in this thread. Early reports are that it stops the freezes during heavy paging.

OK here's one that actually compiles. (3AM was not a good time to be
making patches.)

# mm_swap_token_disable.patch
#       include/linux/swap.h -0 +1
#       mm/rmap.c -0 +3
#       mm/thrash.c -1 +4
#
#       NOTE: On 2.6.9 there is no sysctl to change
#             swap_token_default_timeout.
#
#       Based on a patch by Con Kolivas for 2.6.10
#       Backported to 2.6.9 by Chuck Ebbert <[email protected]>
#
--- 2.6.9.1/include/linux/swap.h
+++ 2.6.9.2/include/linux/swap.h
@@ -230,6 +230,7 @@

/* linux/mm/thrash.c */
extern struct mm_struct * swap_token_mm;
+extern unsigned long swap_token_default_timeout;
extern void grab_swap_token(void);
extern void __put_swap_token(struct mm_struct *);

mm/rmap.c +3 -0
@@ -394,6 +394,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++;
 
mm/thrash.c +5 -1
@@ -19,7 +19,11 @@ 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

_
--
Please take it as a sign of my infinite respect for you, that I insist on you doing all the work.
-- Rusty Russell

#1 lore raw

Any chance this can get into 2.6 before Linus fires off 2.6.10?

Quoted 60 lines · Chuck Ebbert
Quoted 3 lines · Chuck Ebbert

I backported this patch to 2.6.9 but haven't tested it yet. It requires the 'spurious oomkill' patch I posted earlier in this thread. Early reports are that it stops the freezes during heavy paging.

OK here's one that actually compiles. (3AM was not a good time to be
making patches.)

# mm_swap_token_disable.patch
#       include/linux/swap.h -0 +1
#       mm/rmap.c -0 +3
#       mm/thrash.c -1 +4
#
#       NOTE: On 2.6.9 there is no sysctl to change
#             swap_token_default_timeout.
#
#       Based on a patch by Con Kolivas for 2.6.10
#       Backported to 2.6.9 by Chuck Ebbert <[email protected]>
#
include/linux/swap.h +1 -0
@@ -230,6 +230,7 @@
 
 /* linux/mm/thrash.c */
 extern struct mm_struct * swap_token_mm;
+extern unsigned long swap_token_default_timeout;
 extern void grab_swap_token(void);
 extern void __put_swap_token(struct mm_struct *);
 
mm/rmap.c +3 -0
@@ -394,6 +394,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++;
 
mm/thrash.c +5 -1
@@ -19,7 +19,11 @@ 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

_

#2 lore raw
In reply to Chuck Ebbert
Quoted 8 lines · Chuck Ebbert
Quoted 3 lines · Chuck Ebbert

I backported this patch to 2.6.9 but haven't tested it yet. It requires the
'spurious oomkill' patch I posted earlier in this thread. Early reports are that it stops the freezes during heavy paging.

OK here's one that actually compiles. (3AM was not a good time to be
making patches.)

Given that the sysctl is not there in 2.6.9 there is no point exporting the variable only to ignore it. You only need this one liner:

Quoted 4 lines
 {
        int referenced = 0;

+ ignore_token = 1;

Cheers,
Con