From: johann Date: Tue, 22 Sep 2009 22:43:40 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_2_01~1^2~81 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=9580b6e8425127eac4d590ed291bd8dfa81621cb;p=fs%2Flustre-release.git Branch b1_8 b=18505 i=adilger i=andrew Limit number of locks based on low mem on 32-bit systems. --- diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 9ef8337..8571201 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -360,7 +360,8 @@ void get_random_bytes(void *ptr, int size); /* memory */ /* memory size: used for some client tunables */ -#define num_physpages (256 * 1024) /* 1GB */ +#define num_physpages (256 * 1024) /* 1GB */ +#define CFS_NUM_CACHEPAGES num_physpages static inline int copy_from_user(void *a,void *b, int c) { diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index fbe9641a..36abfa0 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -113,7 +113,7 @@ /* * 50 ldlm locks for 1MB of RAM. */ -#define LDLM_POOL_HOST_L ((num_physpages >> (20 - CFS_PAGE_SHIFT)) * 50) +#define LDLM_POOL_HOST_L ((CFS_NUM_CACHEPAGES >> (20 - CFS_PAGE_SHIFT)) * 50) /* * Maximal possible grant step plan in %. diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 268f275..c85210f 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2596,7 +2596,7 @@ static int mdt_setup(struct obd_device *obd, obd_count len, void *buf) mds_max_threads = mds_min_threads = mds_num_threads; } else { /* Base min threads on memory and cpus */ - mds_min_threads = num_possible_cpus() * num_physpages >> + mds_min_threads = num_possible_cpus() * CFS_NUM_CACHEPAGES >> (27 - CFS_PAGE_SHIFT); if (mds_min_threads < MDS_THREADS_MIN) mds_min_threads = MDS_THREADS_MIN; diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index bb93ce9..b95ed35 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -2052,7 +2052,7 @@ static int ost_setup(struct obd_device *obd, obd_count len, void *buf) oss_max_threads = oss_min_threads = oss_num_threads; } else { /* Base min threads on memory and cpus */ - oss_min_threads = num_possible_cpus() * num_physpages >> + oss_min_threads = num_possible_cpus() * CFS_NUM_CACHEPAGES >> (27 - CFS_PAGE_SHIFT); if (oss_min_threads < OSS_THREADS_MIN) oss_min_threads = OSS_THREADS_MIN;