Re: curious crashes when under memory pressure

From: Karl Denninger <karl_at_denninger.net>
Date: Sat, 04 Jan 2025 17:36:20 UTC
On 1/4/2025 12:30, Miroslav Lachman wrote:
> On 04/01/2025 17:27, Chris Torek wrote:
>> On Sat, Jan 4, 2025 at 7:01 AM Peter 'PMc' Much
>> <pmc@citylink.dinoex.sub.org> wrote:
>>>> I'm swapping to a zfs mirror
>>>
>>> Well, You shouldn't do that.
>>
>> Why not? Swapping to a *file* on zfs has obvious issues, but swapping
>> to a mirrored swap partition seems like it should be entirely safe. A
>> bit slow (double writes) but I spent $ on RAM rather than M.2 drives
>> on the theory that I can add those later as needed.
>
> Do you have swap on ZFS or not (in the first post you said "swapping 
> to a zfs mirror")? If yes then it can cause the problems in memory 
> pressure because system has no free memory but ZFS needs memory.
> If you want the swap on a mirror, then use separate partition on 2 
> disks and add gmirror on top of them.
>
> Kind regards
> Miroslav Lachman
>
What's the argument for swapping to a mirror in the first place? If the 
issue is throughput IMHO the answer is to swap to multiple devices.

Putting swap through a filesystem abstraction as noted above runs the 
risk of requiring an allocation of RAM for the operation to complete 
when you're desperately short on it in the first place resulting in 
serious trouble.

-- 
Karl Denninger
karl@denninger.net
/The Market Ticker/
/[S/MIME encrypted email preferred]/