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
This commit is contained in:
Matthew Dillon 2003-01-25 19:32:35 +00:00
parent c3342fe141
commit e027a83457
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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,