diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index 2aa908086d287f48366fb97cf2a9e46a020668da..967cc962d3d6e310106dbf7151b8f5109775bd6a 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -59,7 +59,12 @@ struct obd_device; #define OBD_LDLM_DEVICENAME "ldlm" +#ifdef HAVE_BGL_SUPPORT +/* 1.5 times the maximum 128 tasks available in VN mode */ +#define LDLM_DEFAULT_LRU_SIZE 196 +#else #define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus()) +#endif #define LDLM_DEFAULT_MAX_ALIVE (cfs_time_seconds(36000)) typedef enum { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index f18eb7c43fb28df3bfd03599a8a32f8100867ebd..ff3f128c5c349af72e5f008be4f6edb6617f7668 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -90,10 +90,15 @@ static struct ll_sb_info *ll_init_sbi(void) si_meminfo(&si); pages = si.totalram - si.totalhigh; - if (pages >> (20 - CFS_PAGE_SHIFT) < 512) + if (pages >> (20 - CFS_PAGE_SHIFT) < 512) { +#ifdef HAVE_BGL_SUPPORT + sbi->ll_async_page_max = pages / 4; +#else sbi->ll_async_page_max = pages / 2; - else +#endif + } else { sbi->ll_async_page_max = (pages / 4) * 3; + } sbi->ll_ra_info.ra_max_pages = min(pages / 32, SBI_DEFAULT_READAHEAD_MAX); sbi->ll_ra_info.ra_max_read_ahead_whole_pages = diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index a3208f86356c847a395257fc11e0c2e407ceba3e..e5cdd9a2be5016bb8399f08b812138f985cd3f8e 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -570,8 +570,13 @@ int init_obdclass(void) for (i = 0; i < class_devno_max(); i++) obd_devs[i] = NULL; - /* Default the dirty page cache cap to 1/2 of system memory */ - obd_max_dirty_pages = num_physpages / 2; + /* Default the dirty page cache cap to 1/2 of system memory. + * For clients with less memory, a larger fraction is needed + * for other purposes (mostly for BGL). */ + if (num_physpages <= 512 << (20 - CFS_PAGE_SHIFT)) + obd_max_dirty_pages = num_physpages / 4; + else + obd_max_dirty_pages = num_physpages / 2; err = obd_init_caches(); if (err) diff --git a/lustre/obdfilter/filter_internal.h b/lustre/obdfilter/filter_internal.h index 65a46b75cf0db900c5992938a4b46226248c7acc..668b3d44382db8d95b03e219a98ccbecb7eb0c4b 100644 --- a/lustre/obdfilter/filter_internal.h +++ b/lustre/obdfilter/filter_internal.h @@ -79,7 +79,7 @@ struct filter_mod_data { int fmd_refcount; /* reference counter - list holds 1 */ }; -#ifdef BGL_SUPPORT +#ifdef HAVE_BGL_SUPPORT #define FILTER_FMD_MAX_NUM_DEFAULT 128 /* many active files per client on BGL */ #else #define FILTER_FMD_MAX_NUM_DEFAULT 32