disabled code for CKRM memory class shrinking
authorMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 19 Oct 2004 22:55:10 +0000 (22:55 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 19 Oct 2004 22:55:10 +0000 (22:55 +0000)
kernel/ckrm/ckrm_mem.c
mm/vmscan.c

index 4d38cda..20a7ea6 100644 (file)
@@ -583,6 +583,9 @@ ckrm_get_reclaim_bits(unsigned int *flags, unsigned int *extract)
 void
 ckrm_at_limit(ckrm_mem_res_t *cls)
 {
+#ifndef AT_LIMIT_SUPPORT
+#warning "ckrm_at_limit disabled due to problems with memory hog tests"
+#else
        struct zone *zone;
        unsigned long now = jiffies;
 
@@ -606,6 +609,7 @@ ckrm_at_limit(ckrm_mem_res_t *cls)
                wakeup_kswapd(zone);
                break; // only once is enough
        }
+#endif // AT_LIMIT_SUPPORT
 }
 
 static int unmapped = 0, changed = 0, unchanged = 0, maxnull = 0,
index fa5a5e7..e01d5c9 100644 (file)
 #include <linux/swapops.h>
 #include <linux/ckrm_mem.h>
 
+#ifndef AT_LIMIT_SUPPORT
+#warning "ckrm_at_limit disabled due to problems with memory hog tests -- seting ckrm_shrink_list_empty to true"
+#undef ckrm_shrink_list_empty
+#define ckrm_shrink_list_empty()               (1)
+#endif
+
 /* possible outcome of pageout() */
 typedef enum {
        /* failed to write page out, page is locked */
@@ -719,8 +725,8 @@ redo:
                        list_add(&page->lru, &l_hold);
                        ckrm_mem_dec_active(page);
                        pgmoved++;
-               pgscanned++;
-       }
+                       pgscanned++;
+               }
                if (!--nr_pass && ckrm_flags) {
                        goto redo;
                }
@@ -895,7 +901,7 @@ shrink_zone(struct zone *zone, struct scan_control *sc)
        }
 }
 
-#ifdef CONFIG_CKRM_RES_MEM
+#if defined(CONFIG_CKRM_RES_MEM) && defined(AT_LIMIT_SUPPORT)
 // This function needs to be given more thought.
 // Shrink the class to be at 90% of its limit
 static void
@@ -995,6 +1001,11 @@ ckrm_shrink_classes(void)
 }
 
 #else
+
+#if defined(CONFIG_CKRM_RES_MEM) && !defined(AT_LIMIT_SUPPORT)
+#warning "disabling ckrm_at_limit -- setting ckrm_shrink_classes to noop "
+#endif
+
 #define ckrm_shrink_classes()  do { } while(0)
 #endif