Swappiness setting doesn't stick

Okay third times the charm :smiley:

I tried setting swappiness, but the usual method described in the Arch Wiki did in fact not work.
https://wiki.archlinux.org/title/Swap#Swappiness
Setting via sysctl works, but setting it in /etc/sysctl.d/99-swappiness.conf does not. Could this be related to me running the hardened kernel? I was surprised it is set to 133..

inxi -Faz:
System:
  Kernel: 5.15.10-hardened1-1-hardened x86_64 bits: 64 compiler: gcc
    v: 11.1.0 parameters: pti=on page_alloc.shuffle=1
    BOOT_IMAGE=/@/boot/vmlinuz-linux-hardened
    root=UUID=76975dcf-98db-4177-8706-cced970f0dd1 rw [email protected]
    ipv6.disable=1 quiet splash rd.udev.log_priority=3
    vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1
    resume=UUID=b62d11c9-77f6-468c-a267-95206ded8395 loglevel=3
    ipv6.disable=1
  Desktop: Xfce 4.16.0 tk: Gtk 3.24.29 info: xfce4-panel wm: bspwm 0.9.10
    vt: 7 dm: LightDM 1.30.0 Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop System: Gigabyte product: B550 AORUS PRO V2 v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: B550 AORUS PRO V2 v: x.x
    serial: <superuser required> UEFI: American Megatrends v: F12
    date: 01/18/2021
Battery:
  Device-1: hidpp_battery_0 model: Logitech M570 serial: <filter> charge: 95%
    rechargeable: yes status: Discharging
CPU:
  Info: model: AMD Ryzen 7 5800X bits: 64 type: MT MCP arch: Zen 3
    family: 0x19 (25) model-id: 0x21 (33) stepping: 0 microcode: 0xA201009
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 32 MiB desc: 1x32 MiB
  Speed (MHz): avg: 3521 high: 3584 min/max: 2200/4850 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 3568 2: 3569
    3: 3560 4: 2799 5: 3570 6: 3563 7: 3567 8: 3565 9: 3584 10: 3577 11: 3578
    12: 3566 13: 3565 14: 3572 15: 3559 16: 3583 bogomips: 121414
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional,
    IBRS_FW, STIBP: always-on, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GA106 [GeForce RTX 3060 Lite Hash Rate] vendor: ZOTAC
    driver: nvidia v: 495.46 alternate: nouveau,nvidia_drm bus-ID: 0a:00.0
    chip-ID: 10de:2504 class-ID: 0300
  Display: x11 server: X.Org 1.21.1.2 compositor: picom v: git-c4107
    driver: loaded: nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1600x1200 s-dpi: 96 s-size: 423x318mm (16.7x12.5")
    s-diag: 529mm (20.8")
  Monitor-1: HDMI-0 res: 1600x1200 hz: 60 dpi: 100
    size: 408x306mm (16.1x12.0") diag: 510mm (20.1")
  Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:
  Device-1: NVIDIA vendor: ZOTAC driver: snd_hda_intel v: kernel
    bus-ID: 0a:00.1 chip-ID: 10de:228e class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel bus-ID: 0c:00.4 chip-ID: 1022:1487
    class-ID: 0403
  Device-3: RODE Microphones RØDE NT-USB Mini type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-6.3:4 chip-ID: 19f7:0015
    class-ID: 0300 serial: <filter>
  Sound Server-1: ALSA v: k5.15.10-hardened1-1-hardened running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: no
  Sound Server-4: PipeWire v: 0.3.42 running: yes
Network:
  Device-1: Realtek RTL8125 2.5GbE vendor: Gigabyte driver: r8169 v: kernel
    port: f000 bus-ID: 08:00.0 chip-ID: 10ec:8125 class-ID: 0200
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 1.82 TiB used: 571.06 GiB (30.7%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Corsair
    model: Corsair MP600 PRO XT size: 1.82 TiB block-size: physical: 512 B
    logical: 512 B speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: EIFM31.2 temp: 34.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 1.75 TiB size: 1.75 TiB (100.00%)
    used: 571.06 GiB (31.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 1.75 TiB size: 1.75 TiB (100.00%)
    used: 571.06 GiB (31.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 1.75 TiB size: 1.75 TiB (100.00%)
    used: 571.06 GiB (31.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 1.75 TiB size: 1.75 TiB (100.00%)
    used: 571.06 GiB (31.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 69.09 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-2: swap-2 type: zram size: 62.82 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 38.6 C mobo: N/A gpu: nvidia temp: 45 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
  Processes: 355 Uptime: 13m wakeups: 3 Memory: 62.82 GiB
  used: 3.09 GiB (4.9%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.1.0 Packages: pacman: 1612 lib: 366 flatpak: 0 Shell: Bash
  v: 5.1.12 running-in: xfce4-terminal inxi: 3.3.11

In our standard settings package I see it is in /usr/lib/sysctl.d/99-sysctl-garuda.conf
I'm not on the PC to check and test.
If you want to give a look at it...

Edit:
Check also in

/etc/sysctl.d/99-sysctl-performance-tweaks.conf

If performance tweaks are set

4 Likes

Hi there, as @ filo already told, to change swappiness, run

sudo micro /usr/lib/sysctl.d/99-sysctl-garuda.conf

And change the swappiness in line number 3.

5 Likes

So I basically looked in the wrong place again.. :smiley:
Thank you for your kind help!

3 Likes

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