Skip to content
Snippets Groups Projects
Commit b7a30090 authored by Andreas Dilger's avatar Andreas Dilger
Browse files

Branch HEAD

Change the LU_CACHE size from 30% of free memory to 20% of total memory,
to make the cache size deterministic, and also not depend on a new kernel
symbol.
b=16232
i=nikita
i=yury
parent 81c713ad
No related branches found
No related tags found
No related merge requests found
......@@ -599,22 +599,6 @@ AC_DEFUN([LC_EXPORT___IGET],
])
])
#
# 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"
......@@ -1558,7 +1542,6 @@ AC_DEFUN([LC_PROG_LINUX],
LC_UNREGISTER_BLKDEV_RETURN_INT
LC_KERNEL_SPLICE_READ
LC_HAVE_EXPORTFS_H
LC_EXPORT_NR_FREE_BUFFER_PAGES
])
#
......
......@@ -535,7 +535,7 @@ void lu_site_print(const struct lu_env *env, struct lu_site *s, void *cookie,
EXPORT_SYMBOL(lu_site_print);
enum {
LU_CACHE_PERCENT = 30,
LU_CACHE_PERCENT = 20,
};
/*
......@@ -543,18 +543,26 @@ enum {
*/
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) {
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment