summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2003-01-25 19:32:35 +0000
committerdillon <dillon@FreeBSD.org>2003-01-25 19:32:35 +0000
commit03203fa113be8119537f08625e7e6b23ee2f6999 (patch)
tree9db419a2ac63a9ad5f6b1a3c2a097f112e1b255b /usr.sbin
parent84dc829bfcf899a3a74b734fe602e2a48239ef84 (diff)
downloadFreeBSD-src-03203fa113be8119537f08625e7e6b23ee2f6999.zip
FreeBSD-src-03203fa113be8119537f08625e7e6b23ee2f6999.tar.gz
Change the nominal swap calculation from 1/2 physical memory to 1/8
physical memory. The default is still 2x physical memory. The nominal calculation is used to back-off swap auto-allocation ('A'uto command) when the disk is not large enough to accomodate all filesystem auto-defaults. This gives other partitions (like /usr) more priority over swap on smaller disks. This should help solve reported auto-sizing failures on machines with small hard drives and huge amounts of memory. For example, a machine with 2G of disk and 4G of memory will fail to auto-size without this fix. MFC after: 3 days
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sade/label.c2
-rw-r--r--usr.sbin/sysinstall/label.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index 305eaad..24d438f 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -1350,7 +1350,7 @@ try_auto_label(Device **devs, Device *dev, int perc, int *req)
def = SWAP_MIN_SIZE * ONE_MEG;
if (def > SWAP_AUTO_LIMIT_SIZE * ONE_MEG)
def = SWAP_AUTO_LIMIT_SIZE * ONE_MEG;
- nom = (int)(physmem / 512) / 2;
+ nom = (int)(physmem / 512) / 8;
sz = nom + (def - nom) * perc / 100;
}
swap_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index 305eaad..24d438f 100644
--- a/usr.sbin/sysinstall/label.c
+++ b/usr.sbin/sysinstall/label.c
@@ -1350,7 +1350,7 @@ try_auto_label(Device **devs, Device *dev, int perc, int *req)
def = SWAP_MIN_SIZE * ONE_MEG;
if (def > SWAP_AUTO_LIMIT_SIZE * ONE_MEG)
def = SWAP_AUTO_LIMIT_SIZE * ONE_MEG;
- nom = (int)(physmem / 512) / 2;
+ nom = (int)(physmem / 512) / 8;
sz = nom + (def - nom) * perc / 100;
}
swap_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
OpenPOWER on IntegriCloud