Correct two errors which sabotaged venti's calculation of default cache sizes: - stfree is uninitialized if '-m' parameter not given, which causes the first call of allocbypcnt() to produce bogus results - config.mem is set to ~0 if 'mem =' not given in config file, but sizeallocs() takes this as a genuine value and overrides the default with it, and then allocminima() overrides it again to 1MB Reference: /n/sources/patch/applied/venti-default-memsize Date: Sun Jul 4 18:42:30 CES 2010 Signed-off-by: miller@hamnavoe.com --- /sys/src/cmd/venti/srv/venti.c Sun Jul 4 18:30:52 2010 +++ /sys/src/cmd/venti/srv/venti.c Sun Jul 4 18:30:50 2010 @@ -122,7 +122,7 @@ all = allocbypcnt(20, opt.stfree); /* config file parameters override */ - if (cfg->mem) + if (cfg->mem != 0xffffffffUL) all.mem = cfg->mem; if (cfg->bcmem) all.bcmem = cfg->bcmem; @@ -172,7 +172,6 @@ mem = 0; icmem = 0; bcmem = 0; - stfree = 0; ARGBEGIN{ case 'a': vaddr = EARGF(usage()); @@ -246,8 +245,7 @@ if(configfile == nil) configfile = "venti.conf"; - if(mempcnt > 0) - stfree = freemem(); /* remember free memory for auto-sizing */ + stfree = freemem(); /* remember free memory for auto-sizing */ fprint(2, "conf..."); if(initventi(configfile, &config) < 0) sysfatal("can't init server: %r");