From 996af4066deafecf3fa35f2eddfeeb3f35654d64 Mon Sep 17 00:00:00 2001 From: anserper <anserper> Date: Thu, 10 Jul 2008 22:06:48 +0000 Subject: [PATCH] Branch HEAD 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 941a42a1dd..63a52b5e57 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -27,6 +27,7 @@ #include <linux/types.h> #include <linux/random.h> #include <linux/version.h> +#include <linux/mm.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; + unsigned long pages; + struct sysinfo si; 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); - 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 - 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 = -- GitLab