How to change vm.swappiness value?

Hello, Everyone. I’ve been running CachyOS Plasma for a few hours now, getting it set up. It’s going very smoothly, but I did run into something I can’t easily figure out. It’s the swappiness. It’s been running fine, but this emmc drive isn’t easily replaceable so I’d like to cut back on the swappiness. There appears to be a setting for this in /usr/lib/sysctl.d/99-cachyos-settings.conf, but it’s not changing for me and, yes, I know to reboot after changes. I also tried making a file to set it at /etc/sysctl.d/99-sysctl.conf, but that didn’t change it either. Can someone please tell me where it’s set to 150? Or, maybe you guys are setting it a different way…Please fill me in…

Here’s my specs:

❯ sudo inxi -Famz
[sudo] password for user: 
System:
  Kernel: 6.6.69-1-lts arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm parameters: quiet zswap.enabled=0
    nowatchdog splash rw rootflags=subvol=/@
    root=UUID=25c7925e-3e01-4a6f-9d13-c8be5dc1b739
    initrd=\initramfs-linux-lts.img
  Desktop: KDE Plasma v: 6.2.5 tk: Qt v: N/A wm: kwin_wayland with: krunner
    dm: SDDM Distro: CachyOS base: Arch Linux
Machine:
  Type: Laptop System: Google product: Leona v: 1.0 serial: <filter> Chassis:
    type: 9 serial: N/A
  Mobo: Google model: Leona v: 1.0 serial: <filter> part-nu: sku10337
    UEFI: coreboot v: MrChromebox-2408.1 date: 09/14/2024
Battery:
  ID-1: BAT0 charge: 42.6 Wh (100.0%) condition: 42.6/48.1 Wh (88.5%)
    volts: 12.9 min: 11.9 model: AS1GVPc C433-41 type: Li-ion serial: <filter>
    status: charging cycles: 47
Memory:
  System RAM: total: 4 GiB available: 3.72 GiB used: 2.44 GiB (65.4%)
    igpu: 64 MiB
  Array-1: capacity: 64 GiB note: check slots: 2 modules: 2 EC: None
    max-module-size: 32 GiB note: est.
  Device-1: Channel-0-DIMM-0 type: LPDDR3 detail: N/A size: 2 GiB
    speed: 1867 MT/s volts: curr: 1.2 min: 1.2 max: 1.2 width (bits): data: 64
    total: 64 manufacturer: Samsung part-no: K4E8E324EB-EGCF serial: <filter>
  Device-2: Channel-1-DIMM-0 type: LPDDR3 detail: N/A size: 2 GiB
    speed: 1867 MT/s volts: curr: 1.2 min: 1.2 max: 1.2 width (bits): data: 64
    total: 64 manufacturer: Samsung part-no: K4E8E324EB-EGCF serial: <filter>
CPU:
  Info: model: Intel Core m3-8100Y bits: 64 type: MT MCP arch: Amber/Kaby Lake
    note: check level: v3 note: check built: 2017 process: Intel 14nm family: 6
    model-id: 0x8E (142) stepping: 9 microcode: 0xF6
  Topology: cpus: 1x dies: 1 clusters: 2 cores: 2 threads: 4 tpc: 2
    smt: enabled cache: L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB
    desc: 2x256 KiB L3: 4 MiB desc: 1x4 MiB
  Speed (MHz): avg: 2700 min/max: 400/3400 base/boost: 1600/3400 scaling:
    driver: intel_pstate governor: powersave ext-clock: 100 MHz cores: 1: 2700
    2: 2700 3: 2700 4: 2700 bogomips: 12805
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: IBRS; IBPB: conditional; STIBP: conditional;
    RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel UHD Graphics 615 driver: i915 v: kernel arch: Gen-9.5
    process: Intel 14nm built: 2016-20 ports: active: eDP-1 empty: DP-1, DP-2,
    DP-3, HDMI-A-1, HDMI-A-2, HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:591c
    class-ID: 0300
  Device-2: IMC Networks USB2.0 HD UVC WebCam driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-9:5 chip-ID: 13d3:56d4
    class-ID: 0e02 serial: <filter>
  Display: unspecified server: X.Org v: 24.1.4 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.00x11.26")
    s-diag: 583mm (22.95")
  Monitor-1: eDP-1 model: AU Optronics 0x463d built: 2018 res: 1920x1080
    hz: 60 dpi: 158 gamma: 1.2 size: 309x174mm (12.17x6.85") diag: 355mm (14")
    ratio: 16:9 modes: 1920x1080
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast gbm: drv: iris surfaceless: drv: iris x11: drv: iris
    inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.3-cachyos1.2
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics 615
    (AML-KBL) device-ID: 8086:591c memory: 1.82 GiB unified: yes
  API: Vulkan v: 1.4.303 layers: N/A device: 0 type: integrated-gpu
    name: Intel UHD Graphics 615 (AML-KBL) driver: N/A device-ID: 8086:591c
    surfaces: xcb,xlib
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio driver: snd_soc_avs v: kernel
    alternate: snd_hda_intel,snd_soc_skl bus-ID: 00:1f.3 chip-ID: 8086:9d71
    class-ID: 0401
  API: ALSA v: k6.6.69-1-lts status: kernel-api
    tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.2.7 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 01:00.0 chip-ID: 8086:095a class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
Bluetooth:
  Device-1: Intel Bluetooth wireless interface driver: btusb v: 0.8 type: USB
    rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-3:3 chip-ID: 8087:0a2a
    class-ID: e001
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.2
    lmp-v: 8 status: discoverable: no pairing: no class-ID: 6c010c
Drives:
  Local Storage: total: 235.63 GiB used: 18.77 GiB (8.0%)
  ID-1: /dev/mmcblk0 maj-min: 179:0 vendor: SanDisk model: DA4128
    size: 116.48 GiB block-size: physical: 512 B logical: 512 B type: Removable
    tech: SSD serial: <filter> fw-rev: 0x8 scheme: GPT
  SMART Message: Unknown smartctl error. Unable to generate data.
  ID-2: /dev/mmcblk1 maj-min: 179:24 model: SD128 size: 119.15 GiB
    block-size: physical: 512 B logical: 512 B type: Removable tech: SSD
    serial: <filter> scheme: MBR
  SMART Message: Unknown smartctl error. Unable to generate data.
Partition:
  ID-1: / raw-size: 20 GiB size: 20 GiB (100.00%) used: 10.98 GiB (54.9%)
    fs: btrfs block-size: 4096 B dev: /dev/mmcblk0p2 maj-min: 179:2
  ID-2: /boot raw-size: 600 MiB size: 598.8 MiB (99.80%)
    used: 304.7 MiB (50.9%) fs: vfat block-size: 512 B dev: /dev/mmcblk0p1
    maj-min: 179:1
  ID-3: /home raw-size: 63.89 GiB size: 63.89 GiB (100.00%)
    used: 7.49 GiB (11.7%) fs: btrfs block-size: 4096 B dev: /dev/mmcblk0p3
    maj-min: 179:3
  ID-4: /var/log raw-size: 20 GiB size: 20 GiB (100.00%)
    used: 10.98 GiB (54.9%) fs: btrfs block-size: 4096 B dev: /dev/mmcblk0p2
    maj-min: 179:2
  ID-5: /var/tmp raw-size: 20 GiB size: 20 GiB (100.00%)
    used: 10.98 GiB (54.9%) fs: btrfs block-size: 4096 B dev: /dev/mmcblk0p2
    maj-min: 179:2
Swap:
  Kernel: swappiness: 150 (default 60) cache-pressure: 50 (default 100)
    zswap: no
  ID-1: swap-1 type: zram size: 3.72 GiB used: 256 KiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 4 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 50.0 C pch: 43.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Processes: 241 Power: uptime: 11m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 1.48 GiB services: org_kde_powerdevil,
    power-profiles-daemon, upowerd Init: systemd v: 257 default: graphical
    tool: systemctl
  Packages: pm: pacman pkgs: 1192 libs: 298 tools: octopi,paru Compilers:
    clang: 18.1.8 gcc: 14.2.1 Shell: Sudo (sudo) v: 1.9.16p2 default: Bash
    v: 5.2.37 running-in: konsole inxi: 3.3.36

Thanks so much for any assistance…

did you have a look here

1 Like

I don’t think this is anything to worry about, as we’re not using disk swap but instead swap in RAM.

1 Like

I sort of did. Ok, no I didn’t , but only because I’ve been there many times in the past. That’s where I learned, but Cachy handles it a little differently.

Sorry. I didn’t even see your post in Firefox. The forum colors are all screwed up in there and it’s nearly impossible to read anything. I just installed chrome because of it and now I can see everything great. Surely the CachyOS team is aware of this, unless it’s just my theme screwing it up. I’m not sure yet if it’s just my problem.

Wow. I didn’t snap to that. Thanks for the tip. I suppose it’s swapping by compression then? I’m surprised it’s working so well. I’m running on an altered Chromebook with a fairly weak processor and only 4 gigs of soldered in ddr4. Can’t increase it.

1 Like