From: nikita Date: Sun, 19 Nov 2006 12:39:55 +0000 (+0000) Subject: use nr_free_buffer_pages() to calculate hash table size. It has to be exported. X-Git-Tag: v1_8_0_110~486^2~130 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ebc5b07bbc40d30e3961ffbd81b0151c0edb01a3;p=fs%2Flustre-release.git use nr_free_buffer_pages() to calculate hash table size. It has to be exported. --- 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 index 0000000..1d6712a --- /dev/null +++ b/lustre/kernel_patches/patches/export-nr_free_buffer_pages.patch @@ -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 diff --git a/lustre/kernel_patches/series/2.6-rhel4.series b/lustre/kernel_patches/series/2.6-rhel4.series index 6405575..2e2736e 100644 --- a/lustre/kernel_patches/series/2.6-rhel4.series +++ b/lustre/kernel_patches/series/2.6-rhel4.series @@ -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 diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index f3164bf..10ca014 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -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) {