Whamcloud - gitweb
Change the number of OST buffers depending on how much ram we have. Yes,
authoradilger <adilger>
Thu, 10 Oct 2002 17:36:45 +0000 (17:36 +0000)
committeradilger <adilger>
Thu, 10 Oct 2002 17:36:45 +0000 (17:36 +0000)
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

index 7913e1c..b35b999 100644 (file)
 #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