])
])
-#
-# LC_EXPORT_NR_FREE_BUFFER_PAGES
-# starting from 2.6.23 linux kernel exports nr_free_buffer_pages()
-#
-AC_DEFUN([LC_EXPORT_NR_FREE_BUFFER_PAGES],
-[LB_CHECK_SYMBOL_EXPORT([nr_free_buffer_pages],
-[mm/page_alloc.c],[
- AC_DEFINE(HAVE_EXPORT_NR_FREE_BUFFER_PAGES, 1, [kernel exports nr_free_buffer_pages])
-],[
- if test x$enable_server = xyes ; then
- AC_MSG_ERROR([lustre server needs this symbol to be exported.])
- fi
-])
-])
-
-
AC_DEFUN([LC_LUSTRE_VERSION_H],
[LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
rm -f "$LUSTRE/include/linux/lustre_version.h"
LC_UNREGISTER_BLKDEV_RETURN_INT
LC_KERNEL_SPLICE_READ
LC_HAVE_EXPORTFS_H
- LC_EXPORT_NR_FREE_BUFFER_PAGES
])
#
EXPORT_SYMBOL(lu_site_print);
enum {
- LU_CACHE_PERCENT = 30,
+ LU_CACHE_PERCENT = 20,
};
/*
*/
static int lu_htable_order(void)
{
- int bits;
unsigned long cache_size;
+ int bits;
/*
* Calculate hash table size, assuming that we want reasonable
- * performance when 30% of available memory is occupied by cache of
+ * performance when 20% of total memory is occupied by cache of
* lu_objects.
*
* Size of lu_object is (arbitrary) taken as 1K (together with inode).
*/
- cache_size = ll_nr_free_buffer_pages() / 100 *
- LU_CACHE_PERCENT * (CFS_PAGE_SIZE / 1024);
+ cache_size = num_physpages;
+
+#if BITS_PER_LONG == 32
+ /* limit hashtable size for lowmem systems to low RAM */
+ if (cache_size > 1 << (30 - CFS_PAGE_SHIFT))
+ cache_size = 1 << (30 - CFS_PAGE_SHIFT) * 3 / 4;
+#endif
+
+ cache_size = cache_size / 100 * LU_CACHE_PERCENT *
+ (CFS_PAGE_SIZE / 1024);
for (bits = 1; (1 << bits) < cache_size; ++bits) {
;