[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-user
Subject:    Re: [gentoo-user] Re: Finally got a SSD drive to put my OS on
From:       Wols Lists <antlists () youngman ! org ! uk>
Date:       2023-04-18 23:08:32
Message-ID: 31e6d9f7-3e2b-59aa-f57f-2f18473cd33f () youngman ! org ! uk
[Download RAW message or body]

On 18/04/2023 23:13, Frank Steinmetzger wrote:
>> /var/tmp/portage on tmpfs. And on every disk I allocate a swap partition
>> equal to twice the mobo's max memory. Three drives times 64GB times two is a
>> helluva lot of swap.

> Uhm … why? The moniker of swap = 2×RAM comes from times when RAM was scarce.
> What do you need so much swap for, especially with 32 GB RAM to begin with?
> And if you really do have use cases which cause regular swapping, it'd be
> less painful if you just added some more RAM.

Actually, if you know your history, it does NOT come from "times when 
RAM was scarce". It comes from the original Unix swap algorithm which 
NEEDED twice ram.

I've searched (unsuccessfully) on LWN for the story, but at some point 
(I think round about kernel 2.4.10) Linus ripped out all the ugly 
"optimisation" code, and anybody who ran the vanilla kernel with "swap 
but less than twice ram" found it crashed the instant the system touched 
swap. Linus was not sympathetic to people who hadn't read the release 
notes ...

Andrea Arcangeli and someone else (I've forgotten who) wrote two 
competing memory managers in classic "Linus managerial style" as he 
played them off against each other.

I've always allocated swap like that pretty much ever since. Maybe the 
new algorithm hasn't got the old wanting twice ram, maybe it has, I 
never found out, but I've not changed that habit.

(NB This system is pretty recent, my previous system had iirc 8GB (and a 
maxed out value of 16GB), not enough for a lot of the bigger programs.

Before that point, I gather it actually made a difference to the 
efficiency of the system as the optimisations kicked in, but everybody 
believed it was an old wives tale - until Linus did that ...

Cheers,
Wol

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic