Whamcloud - gitweb
Branch b1_8
authorjohann <johann>
Tue, 22 Sep 2009 22:43:40 +0000 (22:43 +0000)
committerjohann <johann>
Tue, 22 Sep 2009 22:43:40 +0000 (22:43 +0000)
b=18505
i=adilger
i=andrew

Limit number of locks based on low mem on 32-bit systems.

lustre/include/liblustre.h
lustre/ldlm/ldlm_pool.c
lustre/mds/handler.c
lustre/ost/ost_handler.c

index 9ef8337..8571201 100644 (file)
@@ -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)
 {
index fbe9641..36abfa0 100644 (file)
 /*
  * 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 %.
index 268f275..c85210f 100644 (file)
@@ -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;
index bb93ce9..b95ed35 100644 (file)
@@ -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;