Every few days, my desktop at home suddenly slows down. Looking at top, I can see that literally everything is being forced into swap (I have 16G of memory, when the problem starts, I usually have roughly 5-7G of memory used, so very far below the limit, and I can see it drain into swap, until there's 100K of memory used and everything else in swap).
I haven't tinkered with bufcachepercent. At that point the machine is completely frozen, and I have no option besides materially stopping it. If I catch it before that, I can try to reboot it to avoid fsck. Same kind of workload I use at home and at work: lots of chrome with images, lots of image/video displays with mpv, lots of youtube, and also a game that wants webgl (elvenar) which doesn't work on firefox at all. The big difference is that my home box is an amd with a radeon TURKS adapter (r300 I think ?) I suspect something in the memory allocator of dri wants memory with dma constraints, and somehow, the pagedaemon decides to put everything into swap. I've talked a bit to kettenis@, and followed a red herring through to instrumenting the memory allocation routines that this radeon does NOT abuse (namely alloc_pages and friends: allocates a grant total of one single page). I will try to look at the ttm stuff next, probably. Since this takes usually a day or three to trigger, I don't know when this started exactly, but this has been going on for at least a few months. Just in case somebody has a bright idea, or is experiencing similar issues. Here's my dmesg. OpenBSD 7.2-current (GENERIC.MP) #1074: Thu Feb 23 12:15:52 MST 2023 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP real mem = 17108107264 (16315MB) avail mem = 16570232832 (15802MB) random: good seed from bootblocks mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xeb600 (49 entries) bios0: vendor American Megatrends Inc. version "0601" date 12/25/2012 bios0: ASUSTeK COMPUTER INC. CM1435 acpi0 at bios0: ACPI 5.0 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP APIC FPDT MCFG HPET MSDM SSDT SSDT IVRS BGRT acpi0: wakeup devices SBAZ(S4) PS2K(S4) OHC1(S4) EHC1(S4) OHC2(S4) EHC2(S4) OHC3(S4) EHC3(S4) OHC4(S4) XHC0(S4) XHC1(S4) PE21(S4) RLAN(S4) PE22(S4) PE23(S4) PCE2(S4) [...] acpitimer0 at acpi0: 3579545 Hz, 32 bits acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat cpu0 at mainbus0: apid 16 (boot processor) cpu0: AMD A10-5700 APU with Radeon(tm) HD Graphics, 3417.18 MHz, 15-10-01 cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1 cpu0: 16KB 64b/line 4-way D-cache, 64KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu0: smt 0, core 0, package 0 mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges cpu0: apic clock running at 100MHz cpu0: mwait min=64, max=64, IBE cpu1 at mainbus0: apid 17 (application processor) cpu1: AMD A10-5700 APU with Radeon(tm) HD Graphics, 3417.30 MHz, 15-10-01 cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1 cpu1: 16KB 64b/line 4-way D-cache, 64KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu1: smt 1, core 0, package 0 cpu2 at mainbus0: apid 18 (application processor) cpu2: AMD A10-5700 APU with Radeon(tm) HD Graphics, 3417.34 MHz, 15-10-01 cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1 cpu2: 16KB 64b/line 4-way D-cache, 64KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu2: smt 0, core 1, package 0 cpu3 at mainbus0: apid 19 (application processor) cpu3: AMD A10-5700 APU with Radeon(tm) HD Graphics, 3417.62 MHz, 15-10-01 cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1 cpu3: 16KB 64b/line 4-way D-cache, 64KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu3: smt 1, core 1, package 0 ioapic0 at mainbus0: apid 5 pa 0xfec00000, version 21, 24 pins acpimcfg0 at acpi0 acpimcfg0: addr 0xe0000000, bus 0-255 acpihpet0 at acpi0: 14318180 Hz acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus -1 (PE21) acpiprt2 at acpi0: bus 4 (PE22) acpiprt3 at acpi0: bus 5 (PE23) acpiprt4 at acpi0: bus 1 (PCE2) acpiprt5 at acpi0: bus -1 (PCE3) acpiprt6 at acpi0: bus -1 (PCE4) acpiprt7 at acpi0: bus -1 (PCE5) acpiprt8 at acpi0: bus -1 (PCE6) acpiprt9 at acpi0: bus -1 (PCE7) acpiprt10 at acpi0: bus 3 (PE20) acpiprt11 at acpi0: bus 2 (P0PC) acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001 acpicmos0 at acpi0 acpibtn0 at acpi0: PWRB "PNP0C14" at acpi0 not configured acpicpu0 at acpi0: C2(0@100 io@0x1771), C1(@1 halt!), PSS acpicpu1 at acpi0: C2(0@100 io@0x1771), C1(@1 halt!), PSS acpicpu2 at acpi0: C2(0@100 io@0x1771), C1(@1 halt!), PSS acpicpu3 at acpi0: C2(0@100 io@0x1771), C1(@1 halt!), PSS cpu0: 3417 MHz: speeds: 3400 3000 2600 2300 1900 1400 MHz pci0 at mainbus0 bus 0 pchb0 at pci0 dev 0 function 0 "AMD 15/1xh Host" rev 0x00 "AMD 15/1xh IOMMU" rev 0x00 at pci0 dev 0 function 2 not configured ppb0 at pci0 dev 2 function 0 "AMD 15/1xh PCIE" rev 0x00: msi pci1 at ppb0 bus 1 radeondrm0 at pci1 dev 0 function 0 "ATI Turks" rev 0x00 drm0 at radeondrm0 radeondrm0: msi azalia0 at pci1 dev 0 function 1 "ATI Radeon HD 6670 Audio" rev 0x00: msi azalia0: no supported codecs ahci0 at pci0 dev 17 function 0 "AMD Hudson-2 SATA" rev 0x40: msi, AHCI 1.3 ahci0: port 0: 3.0Gb/s ahci0: port 1: 3.0Gb/s ahci0: port 3: 1.5Gb/s scsibus1 at ahci0: 32 targets sd0 at scsibus1 targ 0 lun 0: <ATA, WDC WD40EZRZ-00G, 80.0> naa.50014ee2ba7a43b1 sd0: 3815447MB, 512 bytes/sector, 7814037168 sectors sd1 at scsibus1 targ 1 lun 0: <ATA, WDC WD30EFRX-68E, 82.0> naa.50014ee2b98fd32a sd1: 2861588MB, 512 bytes/sector, 5860533168 sectors cd0 at scsibus1 targ 3 lun 0: <ATAPI, BD E DH12E3SH, MAA3> removable ohci0 at pci0 dev 18 function 0 "AMD Hudson-2 USB" rev 0x11: apic 5 int 18, version 1.0, legacy support ehci0 at pci0 dev 18 function 2 "AMD Hudson-2 USB2" rev 0x11: apic 5 int 17 usb0 at ehci0: USB revision 2.0 uhub0 at usb0 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 addr 1 ohci1 at pci0 dev 19 function 0 "AMD Hudson-2 USB" rev 0x11: apic 5 int 18, version 1.0, legacy support ehci1 at pci0 dev 19 function 2 "AMD Hudson-2 USB2" rev 0x11: apic 5 int 17 usb1 at ehci1: USB revision 2.0 uhub1 at usb1 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 addr 1 piixpm0 at pci0 dev 20 function 0 "AMD Hudson-2 SMBus" rev 0x14: SMI iic0 at piixpm0 iic0: addr 0x20 00=16 01=01 04=2a 06=2a 08=2a 09=24 0a=0f 0b=0e 0c=03 0d=38 0e=e3 0f=44 10=44 13=58 20=16 21=01 22=12 24=2a 26=2a 28=2a 29=14 2a=0f 2b=0e 2c=03 2d=38 2e=f6 2f=44 32=58 40=1d 41=14 42=8f 43=9b 44=01 45=04 46=01 47=01 48=05 50=0f 51=07 52=55 53=ff 60=36 61=24 words 00=1602 01=0100 02=0000 03=0054 04=2a00 05=0054 06=2a00 07=0054 spdmem0 at iic0 addr 0x50: 8GB DDR3 SDRAM PC3-12800 spdmem1 at iic0 addr 0x51: 8GB DDR3 SDRAM PC3-10600 azalia1 at pci0 dev 20 function 2 "AMD Hudson-2 HD Audio" rev 0x01: apic 5 int 16 azalia1: codecs: Realtek ALC887 audio0 at azalia1 pcib0 at pci0 dev 20 function 3 "AMD Hudson-2 LPC" rev 0x11 ppb1 at pci0 dev 20 function 4 "AMD Hudson-2 PCI" rev 0x40 pci2 at ppb1 bus 2 em0 at pci2 dev 5 function 0 "Intel 82540EM" rev 0x02: apic 5 int 20, address 00:07:e9:3e:60:2f ppb2 at pci0 dev 21 function 0 "AMD Hudson-2 PCIE" rev 0x00 pci3 at ppb2 bus 3 ppb3 at pci0 dev 21 function 2 "AMD Hudson-2 PCIE" rev 0x00 pci4 at ppb3 bus 4 re0 at pci4 dev 0 function 0 "Realtek 8168" rev 0x09: RTL8168F/8111F (0x4800), msi, address 60:a4:4c:e8:14:65 rgephy0 at re0 phy 7: RTL8169S/8110S/8211 PHY, rev. 5 ppb4 at pci0 dev 21 function 3 "AMD Hudson-2 PCIE" rev 0x00 pci5 at ppb4 bus 5 em1 at pci5 dev 0 function 0 "Intel 82574L" rev 0x00: msi, address 00:1b:21:cd:93:32 pchb1 at pci0 dev 24 function 0 "AMD 15/1xh Link Cfg" rev 0x00 pchb2 at pci0 dev 24 function 1 "AMD 15/1xh Address Map" rev 0x00 pchb3 at pci0 dev 24 function 2 "AMD 15/1xh DRAM Cfg" rev 0x00 km0 at pci0 dev 24 function 3 "AMD 15/1xh Misc Cfg" rev 0x00 pchb4 at pci0 dev 24 function 4 "AMD 15/1xh CPU Power" rev 0x00 pchb5 at pci0 dev 24 function 5 "AMD 15/1xh NB Power" rev 0x00 usb2 at ohci0: USB revision 1.0 uhub2 at usb2 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 addr 1 usb3 at ohci1: USB revision 1.0 uhub3 at usb3 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 addr 1 isa0 at pcib0 isadma0 at isa0 pckbc0 at isa0 port 0x60/5 irq 1 irq 12 pckbd0 at pckbc0 (kbd slot) wskbd0 at pckbd0: console keyboard pcppi0 at isa0 port 0x61 spkr0 at pcppi0 vmm0 at mainbus0: SVM/RVI umass0 at uhub0 port 5 configuration 1 interface 0 "Generic USB2.0-CRW" rev 2.00/58.88 addr 2 umass0: using SCSI over Bulk-Only scsibus2 at umass0: 2 targets, initiator 0 sd2 at scsibus2 targ 1 lun 0: <Generic-, Multi-Card, 1.00> removable serial.0bda0158114173400000 uvideo0 at uhub1 port 3 configuration 1 interface 0 "Guillemot Corporation Hercules Optical Glass" rev 2.00/0.00 addr 2 video0 at uvideo0 uaudio0 at uhub1 port 3 configuration 1 interface 3 "Guillemot Corporation Hercules Optical Glass" rev 2.00/0.00 addr 2 uaudio0: class v1, high-speed, sync, channels: 0 play, 1 rec, 2 ctls audio1 at uaudio0 uhidev0 at uhub2 port 3 configuration 1 interface 0 "Logitech USB Optical Mouse" rev 2.00/72.00 addr 2 uhidev0: iclass 3/1 ums0 at uhidev0: 3 buttons, Z dir wsmouse0 at ums0 mux 0 vscsi0 at root scsibus3 at vscsi0: 256 targets softraid0 at root scsibus4 at softraid0: 256 targets root on sd0a (5475a5be2d265ed0.a) swap on sd0b dump on sd0b WARNING: / was not properly unmounted radeondrm0: TURKS radeondrm0: 1920x1080, 32bpp wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0 wsdisplay0: screen 1-5 added (std, vt100 emulation)