News: 0001608515

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

New Patches Aim To Lower Linux Memory Use For Swap, Slightly Improve Performance

([Linux Kernel] 33 Minutes Ago Better Swap)


Kairui Song of Tencent sent out a new patch series overnight working on enhancing the Linux kernel's swap code. With the patches there are some memory savings -- and more on the way -- while also providing for slightly faster performance.

The patch series removes the static "swap_map" and uses the swap table for the swap count directly. This conserves around 30% memory use for the static swap metadata, which amounts to 256MB of memory when mounting a 1TB swap device... Granted, using a 1TB swap device isn't too common outside of perhaps some very large server setups.

Another 512MB or so of memory savings is expected from some ongoing work for another round of swap / memory management patches.

Besides those swap metadata memory savings, the performance is found to be slightly faster when under global memory pressure. Kernel builds under memory pressure on some smaller x86_64 and ARM64 VMs with limited RAM were found to be 1.6% to 2.4% faster. Redis/Valkey was also around 1.5% faster with this patch series.

Those interested in this work can find these latest swap/mm patches out for review on the [1]Linux kernel mailing list .



[1] https://lore.kernel.org/lkml/20260126-swap-table-p3-v1-0-a74155fab9b0@tencent.com/



Lassie looked brilliant, in part because the farm family she
lived with was made up of idiots. Remember? One of them was always
getting pinned under the tractor, and Lassie was always rushing back to
the farmhouse to alert the other ones. She'd whimper and tug at their
sleeves, and they'd always waste precious minutes saying things: "Do
you think something's wrong? Do you think she wants us to follow her?
What is it, girl?", etc., as if this had never happened before, instead
of every week. What with all the time these people spent pinned under
the tractor, I don't see how they managed to grow any crops whatsoever.
They probably got by on federal crop supports, which Lassie filed the
applications for.
-- Dave Barry