dool icon indicating copy to clipboard operation
dool copied to clipboard

/dev/ramX devices do not work with --disk

Open KJ7LNW opened this issue 1 year ago • 10 comments

SUMMARY

sda works, ram0 doesn't show:

dool  -D sda,ram0
┄┄total┄cpu┄usage┄┄┬┄┄dsk/sda┄┄┬┄net/total┄┬┄┄┄load┄avg┄┄┄┬┄┄┄┄┄system┄┄┄┄
usr sys idl wai stl│ read  writ│ recv  send│ 1m   5m  15m │      time     
  0   1  99   0   0│  27k  116k│   0     0 │0.21 0.28 0.27│Nov-30 13:51:05
ISSUE TYPE
  • Bug Report
DOOL VERSION

~1.3.1 (dool-next)

OS / ENVIRONMENT

oracle linux 9

STEPS TO REPRODUCE
modprobe brd rd_size=$((1 * 1024*1024)) rd_nr=2
dool  -D sda,ram0
EXPECTED RESULTS

ram0 IO stats

ACTUAL RESULTS

ram0 is not listed.

KJ7LNW avatar Nov 30 '23 21:11 KJ7LNW

It looks like this is related to a line in the dool_disk plugin:

if set(l[3:]) == {'0'}: continue

I'm not familiar with this but it landed in commit fa079a43c97f772a4809304386dbed5f4afa9a54. Looks like we're purposely skipping devices that have all zeros in /proc/disktats. If I comment out this line dool will read ram0 as a disk. I don't know how to get it to generate IO though, so I can't test if dool actually reads it.

Can you try commenting out the line and seeing if you see IO in dool afterwards?

scottchiefbaker avatar Nov 30 '23 22:11 scottchiefbaker

@leahneukirchen since you wrote the fix mentioned above do you mind commenting on this issue? Maybe between the three of us we can come up with a good solution.

scottchiefbaker avatar Nov 30 '23 22:11 scottchiefbaker

Comment where? I tried these, but still doesn't show:

dool_disk_avgqu.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_avgqu.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_avgrq.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_avgrq.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_svctm.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_svctm.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_tps.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_tps.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_util.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_util.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_wait.py:            #if set(l[3:]) == {'0'}: continue
dool_disk_wait.py:            #if set(l[3:]) == {'0'}: continue
dool.py:            #if set(l[3:]) == {'0'}: continue
dool.py:            #if set(l[3:]) == {'0'}: continue
dool.py:            #if set(l[3:]) == {'0'}: continue
dool.py:            #if set(l[3:]) == {'0'}: continue

KJ7LNW avatar Nov 30 '23 22:11 KJ7LNW

Comment out line 868 in dool.py. When I comment out that line and run ./dool --more -D sda,ram0 I see ram0 in the output.

I cannot get it to increment any stats though. Not sure how/if the kernel updates /proc/diskstats for those ram disks.

scottchiefbaker avatar Nov 30 '23 22:11 scottchiefbaker

it shows, but I cant get stats out of it:

modprobe brd rd_size=$((1024*1024))
dd if=/dev/zero of=/dev/ram0 bs=1M & ./dool -D ram0

I opened a stack exchange question on the subject in case somebody else has seen this before.

KJ7LNW avatar Dec 01 '23 00:12 KJ7LNW

If we can get it to populate /proc/diskstats I think it will just automagically work. Hopefully someone on StackExhange will know.

scottchiefbaker avatar Dec 01 '23 01:12 scottchiefbaker

I think you are right, this is not a dool problem.

However, it would save me (and others?) from opening a ticket if dool gave a warning about /dev/ram0 not having any data and thus being excluded.

Maybe this could be fixed by printing a warning instead of by implementation.

KJ7LNW avatar Dec 01 '23 01:12 KJ7LNW

Is iostat able to read stats for ram disks? I kind of doubt it since nothing is showing up in /proc/diskstats but it might be worth double checking.

scottchiefbaker avatar Dec 01 '23 06:12 scottchiefbaker

Yes, ram0 doesn't keep track of any disk stats (but e.g. zram does, and dool works for it).

I don't think this is a dool issue therefore.

leahneukirchen avatar Dec 01 '23 12:12 leahneukirchen

Is iostat able to read stats for ram disks?

It does not.

KJ7LNW avatar Dec 02 '23 02:12 KJ7LNW

Closing this as CANTFIX because it's a kernel issue. If/when the kernel tracks stats for these ram disks dool will automatically work.

scottchiefbaker avatar Apr 21 '24 21:04 scottchiefbaker