What's the point of having swap support enabled in the kernel?

What am I missing? On my router I have 8 MB flash RAM and 128 MB normal RAM, so it seems to me that there is no point in trying to swap anything out of the RAM.

you are right. swap is pointless since there's no swap device/partition.

[ you don't really mention your router, nor the target architecture it is based on, so this can only be a very generic answer ]

The same kernel binaries, with all its configuration symbols, is shared among all devices of one target architecture (in the sense of ar71xx, brcm47xx, ipq806x, etc.) - those which have decent amounts of RAM and those that don't. Swap can be added via USB, SATA (yes, some routers have SATA controllers), sdhc or even GPIO based bit-banged sd cards - in most cases that doesn't make a whole lot of sense these days, but there are still users who swear by the importance of swap, zram or similar placebos.

1 Like

Swap is required sometimes. For example you have 64 or 128 mb router and want TOR.
Or want to compile something on the router with gcc or need some python monster software
64 is not enough, 128 also may be not enough

I dont think swap support add lots of kernel code. Unless you're on 4 mb flash having +2-3 kb in kernel is not a problem.
But supporting many variations of public builds is real problem