Swap Function not implemented

Hi there,
I'm building openwrt v19.07.4 for TL-WR941N v6 (CN) and I'm getting this error when trying to enable swap on zram0: Function not implemented.
Support for paging of anonymous memory (swap ) is enabled in kernel config.

Swap support takes valuable RAM, zram support takes valuable RAM... on top of that, you reserve some of the little RAM left as zram to do swap on it. Are you sure you want to do this?

1 Like

Verify the resulting config and perform a clean build:

Well, just see zram's memory compression efficiency. I'm sure yes, because zram can extend RAM at least on 50%. Moreover, without losing performance.
vid

This, I am loath to say, is wishful thinking. Memory compression might work well most of the time, but typically has some nasty failure modes, where compression does not work well and you end up with less usable memory than without it. I suffer from the memory compressor in macos and all I can say is, if I had a realistic choice I would jettison that feature ASAP.
Now, at lot of use-cases fall into the "most of the time" category and hence see a more positive outcome of memory compression, but please do not loose sight of its potential side-effects.

3 Likes

Found in config/Config-kernel.in
Need change

config KERNEL_SWAP
        bool "Support for paging of anonymous memory (swap)"
        default y if !SMALL_FLASH

to

config KERNEL_SWAP
        bool "Support for paging of anonymous memory (swap)"
        default y

before any changes / configurations, and then enable zram in menuconfig. I wonder on openwrt's wiki no one word about that, that this config overwrites kernel_menuconfig.

There is a reason why it was configured like that: swap support takes RAM space, which is already very scarce on your 4MB device.

No need to change that if you simply append the options to the config and run defconfig.
My router is also marked with SMALL_FLASH and this method works well:
19.07: Swap doesn't work on D-Link DIR-620 D1 (ramips/rt305x) due to small_flash

16M device.

Well, I think both ways is ok. But thank you!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.