On Tue, 2005-01-11 at 12:30 -0600, Steven Pratt wrote:
> Also, is it maybe time to increase the default number of locks?  We had 
> similar problems on large systems in SLES9 testing and we still have to 
> run SPECSFS with TxLocks  set to 65k.

How's this look?

===== fs/jfs/jfs_txnmgr.c 1.64 vs edited =====
--- 1.64/fs/jfs/jfs_txnmgr.c    2004-11-01 07:59:47 -06:00
+++ edited/fs/jfs/jfs_txnmgr.c  2005-01-11 13:44:12 -06:00
@@ -93,15 +93,15 @@
 } TxStat;
 #endif
 
-static int nTxBlock = 512;     /* number of transaction blocks */
+static int nTxBlock = -1;      /* number of transaction blocks */
 module_param(nTxBlock, int, 0);
 MODULE_PARM_DESC(nTxBlock,
-                "Number of transaction blocks (default:512, max:65536)");
+                "Number of transaction blocks (max:65536)");
 
-static int nTxLock = 4096;     /* number of transaction locks */
+static int nTxLock = -1;       /* number of transaction locks */
 module_param(nTxLock, int, 0);
 MODULE_PARM_DESC(nTxLock,
-                "Number of transaction locks (default:4096, max:65536)");
+                "Number of transaction locks (max:65536)");
 
 struct tblock *TxBlock;                /* transaction block table */
 static int TxLockLWM;          /* Low water mark for number of txLocks used */
@@ -249,6 +249,25 @@
 int txInit(void)
 {
        int k, size;
+       struct sysinfo si;
+
+       /* Set defaults for nTxLock and nTxBlock if unset */
+
+       if (nTxLock == -1) {
+               if (nTxBlock == -1) {
+                       /* Base default on memory size */
+                       si_meminfo(&si);
+                       if (si.totalram > (256 * 1024)) /* 1 GB */
+                               nTxLock = 64 * 1024;
+                       else
+                               nTxLock = si.totalram >> 2;
+               } else if (nTxBlock > (8 * 1024))
+                       nTxLock = 64 * 1024;
+               else
+                       nTxLock = nTxBlock << 3;
+       }
+       if (nTxBlock == -1)
+               nTxBlock = nTxLock >> 3;
 
        /* Verify tunable parameters */
        if (nTxBlock < 16)
@@ -259,6 +278,9 @@
                nTxLock = 256;  /* No one should set it this low */
        if (nTxLock > 65536)
                nTxLock = 65536;
+
+       printk(KERN_INFO "JFS: nTxBlock = %d, nTxLock = %d\n",
+              nTxBlock, nTxLock);
        /*
         * initialize transaction block (tblock) table
         *
@@ -266,8 +288,8 @@
         * tid = 0 is reserved.
         */
        TxLockLWM = (nTxLock * 4) / 10;
-       TxLockHWM = (nTxLock * 8) / 10;
-       TxLockVHWM = (nTxLock * 9) / 10;
+       TxLockHWM = (nTxLock * 7) / 10;
+       TxLockVHWM = (nTxLock * 8) / 10;
 
        size = sizeof(struct tblock) * nTxBlock;
        TxBlock = (struct tblock *) vmalloc(size);


_______________________________________________
Jfs-discussion mailing list
Jfs-discussion@www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion

Reply via email to