Suspicious reporting of swap space usage

Fedora 42

2 external Western Digital USB disks, each with a swap partition of 128GB.

I consistently see that my system reports strange values for

  1. swap space used
  2. available memory (via “free”)

Just after boot, my two external Western Digital drives show constant activity. “iostat” shows that there is a lot of disk reads (on the order of several hundred kB/sec). But I’m doing nothing on my system other than the following:

Every few seconds executing “swapon --show”
Every few seconds executing “free” in a bash shell

Yet the swap space is continually increasing. Here is some sample showing what some alternating calls to “swapon --show” and “free” a few minutes after rebooting my system.

$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G 139.1M  200
/dev/sdb4  partition 128.5G   138M  200
$
$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G 160.3M  200
/dev/sdb4  partition 128.5G 158.9M  200
$ 
$ 
$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G 154.7M  200
/dev/sdb4  partition 128.5G 153.8M  200
$ 
$ 
$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G   163M  200
/dev/sdb4  partition 128.5G 162.2M  200
$ free
               total        used        free      shared  buff/cache   available
Mem:        28423288     3905500    20723660      158996     4385980    24517788
Swap:      277919732      332836   277586896
$ 
$ 
$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G 190.5M  200
/dev/sdb4  partition 128.5G 188.8M  200
$ 
$ swapon --show
NAME       TYPE        SIZE   USED PRIO
/dev/zram0 partition     8G     0B  100
/dev/sda4  partition 128.5G 209.8M  200
/dev/sdb4  partition 128.5G 207.4M  200
$ free
               total        used        free      shared  buff/cache   available
Mem:        28423288     4008296    20615908      168296     4400684    24414992
Swap:      277919732      427184   277492548
$ 

And here is some sample output of “iostat 5”

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.78    0.03    1.52    5.54    0.00   90.13

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
nvme0n1         197.00     22765.60       116.00         0.00     113828        580          0
sda             348.00       304.00      3235.20         0.00       1520      16176          0
sdb             350.00       224.00      3292.00         0.00       1120      16460          0
zram0             0.00         0.00         0.00         0.00          0          0          0


avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.90    0.03    1.20    5.79    0.00   91.08

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
nvme0n1         138.60     16017.60         0.00         0.00      80088          0          0
sda             217.60       496.80      1227.20         0.00       2484       6136          0
sdb             208.40       348.00      1092.00         0.00       1740       5460          0
zram0             0.00         0.00         0.00         0.00          0          0          0


avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.97    0.01    1.23    5.85    0.00   90.95

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
nvme0n1         149.00     17137.60        13.60         0.00      85688         68          0
sda              52.20       421.60         0.00         0.00       2108          0          0
sdb              33.20       228.00         0.00         0.00       1140          0          0
zram0             0.00         0.00         0.00         0.00          0          0          0



I only have 3 bash windows open, and I did not even have a browser open until I needed to start firefox to post this question.

I ran “ps -elf” but don’t see fsck running. But perhaps there is another program doing some kind of disk integrity checking? (I’m an old SunOS and Solaris guy, so fsck is what we used to run).

I don’t know how to figure out which process (program) is accessing the external USB drives.

Here are the first few lines of “top”

top - 18:28:53 up 28 min,  2 users,  load average: 2.30, 2.37, 2.01
Tasks: 453 total,   2 running, 451 sleeping,   0 stopped,   0 zombie
top - 18:30:14 up 30 min,  2 users,  load average: 2.03, 2.28, 2.00
Tasks: 451 total,   1 running, 450 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.1 us,  0.3 sy,  0.0 ni, 93.3 id,  6.1 wa,  0.1 hi,  0.1 si,  0.0 st 
MiB Mem :  27757.1 total,  19646.9 free,   4328.4 used,   4369.3 buff/cache     
MiB Swap: 271406.0 total, 271031.3 free,    374.7 used.  23428.7 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                             
   5276 vartan    20   0   11.7g 652028 279532 S   2.4   2.3   1:44.44 firefox                             
   4178 vartan    39  19  257.0g 183680  90916 D   1.2   0.6   1:03.70 baloo_file_extr                     
   2062 vartan    -2   0 3494184 378676 287296 S   0.8   1.3   0:55.87 kwin_wayland                        
    976 root      20   0       0      0      0 D   0.6   0.0   0:07.37 usb-storage                         
   2933 vartan    20   0 1949776 150900 128968 S   0.6   0.5   0:04.62 konsole                             
    973 root      20   0       0      0      0 S   0.4   0.0   0:07.43 usb-storage                         
      1 root      20   0   38232  20768  11328 S   0.2   0.1   0:05.92 systemd                             
    176 root       0 -20       0      0      0 I   0.2   0.0   0:00.22 kworker/5:1H-kblockd                
    425 root       0 -20       0      0      0 I   0.2   0.0   0:00.08 kworker/3:1H-kblockd                
   1179 systemd+  20   0   16300   7472   6576 S   0.2   0.0   0:02.26 systemd-oomd    

I don’t know what “usb-storage” is; I don’t find such a program from “which usb-storage”

I did an internet search which indicated that baloo_file_extr is an indexer for Plasma desktop. Is this true? One conversation I saw said “if you see it again, kill it” but the context was Arch Linux.
https://forums.linuxmint.com/viewtopic.php?t=320458

Should baloo_file_extr be running? But how long should it take? When can I assume there is a problem with it?

Also, I still believe something is seriously wrong with swap. According to “free” I have 24GB of RAM “available”.

$ free
               total        used        free      shared  buff/cache   available
Mem:        28423288     4287160    20183636      169180     4555068    24136128
Swap:      277919732      389728   277530004
$ 

Update… after 41 minutes since boot, things appear nominal…

Except for my confusion on why the system would be using so much swap when there is so much “available” RAM.

$ uptime
 18:41:26 up 41 min,  2 users,  load average: 1.01, 1.93, 2.04
$ 
$ swapon --show
NAME       TYPE        SIZE USED PRIO
/dev/zram0 partition     8G   0B  100
/dev/sda4  partition 128.5G 4.3M  200
/dev/sdb4  partition 128.5G   5M  200
$ 
$ free
               total        used        free      shared  buff/cache   available
Mem:        28423288     4106360    20021624      181176     4909884    24316928
Swap:      277919732        9548   277910184
$ 

baloo_file_extr is using almost as much time as firefox and is niced so it has a 39 priority on running.

Apparently you are using kde plasma and that is the file indexer

If you search for baloo-file-extractor you will find many posts about cpu usage and swap usage, including this one (and not just for fedora)

Those reports go back more than 5 years.