Whamcloud - gitweb
use nr_free_buffer_pages() to calculate hash table size. It has to be exported.
authornikita <nikita>
Sun, 19 Nov 2006 12:39:55 +0000 (12:39 +0000)
committernikita <nikita>
Sun, 19 Nov 2006 12:39:55 +0000 (12:39 +0000)
lustre/kernel_patches/patches/export-nr_free_buffer_pages.patch [new file with mode: 0644]
lustre/kernel_patches/series/2.6-rhel4.series
lustre/obdclass/lu_object.c

diff --git a/lustre/kernel_patches/patches/export-nr_free_buffer_pages.patch b/lustre/kernel_patches/patches/export-nr_free_buffer_pages.patch
new file mode 100644 (file)
index 0000000..1d6712a
--- /dev/null
@@ -0,0 +1,12 @@
+Index: linux/mm/page_alloc.c
+===================================================================
+--- linux.orig/mm/page_alloc.c
++++ linux/mm/page_alloc.c
+@@ -875,6 +875,7 @@ unsigned int nr_free_buffer_pages(void)
+ {
+       return nr_free_zone_pages(GFP_USER & GFP_ZONEMASK);
+ }
++EXPORT_SYMBOL(nr_free_buffer_pages);
+ /*
+  * Amount of free RAM allocatable within all zones
index 6405575..2e2736e 100644 (file)
@@ -34,3 +34,4 @@ pag-basic-2.6-rhel4.patch
 dynamic-locks-2.6.9.patch 
 jbd-copy-out-everything.patch 
 jbd-checkpoint-on-commit.patch 
+export-nr_free_buffer_pages.patch 
index f3164bf..10ca014 100644 (file)
@@ -564,7 +564,7 @@ static int lu_htable_order(void)
          *
          * Size of lu_object is (arbitrary) taken as 1K (together with inode).
          */
-        cache_size = nr_free_pages() / 100 *
+        cache_size = nr_free_buffer_pages() / 100 *
                 LU_CACHE_PERCENT * (CFS_PAGE_SIZE / 1024);
 
         for (bits = 1; (1 << bits) < cache_size; ++bits) {