Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3646 - Unable to Swap /proc/swaps does not exist (ramips rt305x/) #8682

Closed
openwrt-bot opened this issue Feb 27, 2021 · 2 comments
Closed

FS#3646 - Unable to Swap /proc/swaps does not exist (ramips rt305x/) #8682

openwrt-bot opened this issue Feb 27, 2021 · 2 comments
Labels
flyspray kernel release/19.07

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Feb 27, 2021

xapukserge:

Device Dlink DIR320 rev.B1
OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.044.30835-34e0d65

Istalled packages:
block-mount
kmod-usb-core
kmod-usb2
kmod-usb-ohci
kmod-usb-storage
kmod-fs-ext4
zram-swap
swap-utils

How-to:
root@OpenWrt:~# mkswap /dev/sda1
mkswap: /dev/sda1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 511 MiB (535818240 bytes)
no label, UUID=5413e04d-954e-493c-b26d-926a67af1bbc

root@OpenWrt:~# swapon -a
block: failed to swapon /dev/sda1

root@OpenWrt:~# cat /proc/swaps
cat: can't open '/proc/swaps': No such file or directory

So, I think, swap module was accidentally turned off during building firmware, because OpenWRT build version 18.06 works fine!

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Feb 28, 2021

odmdas:

Hi, xapukserge.

A quick search showed that the swap option is enabled for all targets except those marked as small_flash [0].

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

rt305x is marked as small_flash [1].

FEATURES+=usb ramdisk small_flash

small_flash feature flag was introduced in commit cf7154d.

You can try building a modified OpenWrt with the swap option forcibly enabled and see if there is any worth. Especially on the upcoming 21.02 release with the 5.4 kernel. Post your results.
I use a similar device, ZyXEL Keenetic, without LuCI, and there are some free megabytes of RAM.
What is your use case in which swap is needed?

[0] https://github.com/openwrt/openwrt/blob/v19.07.6/config/Config-kernel.in

[1] https://github.com/openwrt/openwrt/blob/v19.07.6/target/linux/ramips/rt305x/target.mk

@aparcar aparcar added release/19.07 kernel labels Feb 22, 2022
@981213
Copy link
Member

@981213 981213 commented Mar 7, 2022

Swap support is disabled for small_flash targets to save space. This isn't really a bug.

@981213 981213 closed this Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray kernel release/19.07
Projects
None yet
Development

No branches or pull requests

3 participants