Whamcloud - gitweb
Branch HEAD
authoranserper <anserper>
Thu, 10 Jul 2008 22:06:48 +0000 (22:06 +0000)
committeranserper <anserper>
Thu, 10 Jul 2008 22:06:48 +0000 (22:06 +0000)
b=16037
i=Alexey Lyashkov(shadow)
i=Johann Lombardi(johann)

Limit amount of ll pages with a part of lowmem pages instead of total number of pages (affects 32-bit platforms).

lustre/llite/llite_lib.c

index 941a42a..63a52b5 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/types.h>
 #include <linux/random.h>
 #include <linux/version.h>
 #include <linux/types.h>
 #include <linux/random.h>
 #include <linux/version.h>
+#include <linux/mm.h>
 
 #include <lustre_lite.h>
 #include <lustre_ha.h>
 
 #include <lustre_lite.h>
 #include <lustre_ha.h>
@@ -55,6 +56,8 @@ extern struct address_space_operations ll_dir_aops;
 static struct ll_sb_info *ll_init_sbi(void)
 {
         struct ll_sb_info *sbi = NULL;
 static struct ll_sb_info *ll_init_sbi(void)
 {
         struct ll_sb_info *sbi = NULL;
+        unsigned long pages;
+        struct sysinfo si;
         class_uuid_t uuid;
         int i;
         ENTRY;
         class_uuid_t uuid;
         int i;
         ENTRY;
@@ -69,10 +72,13 @@ static struct ll_sb_info *ll_init_sbi(void)
         spin_lock_init(&sbi->ll_process_lock);
         sbi->ll_rw_stats_on = 0;
         INIT_LIST_HEAD(&sbi->ll_pglist);
         spin_lock_init(&sbi->ll_process_lock);
         sbi->ll_rw_stats_on = 0;
         INIT_LIST_HEAD(&sbi->ll_pglist);
-        if (num_physpages >> (20 - CFS_PAGE_SHIFT) < 512)
-                sbi->ll_async_page_max = num_physpages / 2;
+
+        si_meminfo(&si);
+        pages = si.totalram - si.totalhigh;
+        if (pages >> (20 - CFS_PAGE_SHIFT) < 512)
+                sbi->ll_async_page_max = pages / 2;
         else
         else
-                sbi->ll_async_page_max = (num_physpages / 4) * 3;
+                sbi->ll_async_page_max = (pages / 4) * 3;
         sbi->ll_ra_info.ra_max_pages = min(num_physpages / 8,
                                            SBI_DEFAULT_READAHEAD_MAX);
         sbi->ll_ra_info.ra_max_read_ahead_whole_pages =
         sbi->ll_ra_info.ra_max_pages = min(num_physpages / 8,
                                            SBI_DEFAULT_READAHEAD_MAX);
         sbi->ll_ra_info.ra_max_read_ahead_whole_pages =