From 574f83d306c1e94b74b6bbdc01d2f2a1aec1f8ff Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 10 Oct 2002 17:36:45 +0000 Subject: [PATCH] Change the number of OST buffers depending on how much ram we have. Yes, we could run out of space this way, but at least people will be able to use Lustre on machines with < 2 GB of ram (that aren't UML). --- lustre/include/linux/lustre_net.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 7913e1c..b35b999 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -56,15 +56,16 @@ #define MDS_BUFSIZE (64 * 1024) #define MDS_MAXREQSIZE 1024 -#ifdef __arch_um__ +//#ifdef __arch_um__ +#if 0 #define OST_NEVENTS 1024 #define OST_NBUFS 10 #define OST_BUFSIZE (64 * 1024) #define OST_MAXREQSIZE (8 * 1024) #else -#define OST_NEVENTS 32768 -#define OST_NBUFS 160 -#define OST_BUFSIZE (128 * 1024) +#define OST_NEVENTS min(num_physpages / 16, 32768UL) +#define OST_NBUFS min(OST_NEVENTS / 100, 256UL) +#define OST_BUFSIZE ((OST_NEVENTS > 4096UL ? 128 : 64) * 1024) #define OST_MAXREQSIZE (8 * 1024) #endif -- 1.8.3.1