htop icon indicating copy to clipboard operation
htop copied to clipboard

Dirty and Writeback meter, pretty please.

Open martixy opened this issue 2 years ago • 6 comments

As the title. Could be as part of Disk IO, could be standalone. Quite useful either way.

Thank you! Love this program ♥

Didn't even know terminal could have mouse interactions before. Mind blown.

martixy avatar May 06 '23 23:05 martixy

Can you point to some references documenting where these values can be read/queried from? Ideally this should be available on multiple platforms, thus if you can point to matching documentation for different systems, this would be nice.

BenBE avatar May 07 '23 19:05 BenBE

Oh, uh. /proc/meminfo They are the values for the disk cache in RAM.

Not sure what you mean by multiple platforms. I think they're universal?

I'm quite new to linux. Sorry.


Tiny rant: I have not found a working way to turn off write caching, so one use case is when using removable devices (i.e. usb drives), to monitor Dirty so you know when a transfer has ACTUALLY completed. It's a poor user experience, but a way to monitor Dirty at least provides a workaround.

martixy avatar May 08 '23 07:05 martixy

Oh, uh. /proc/meminfo They are the values for the disk cache in RAM.

Not sure what you mean by multiple platforms. I think they're universal?

FreeBSD (and most other *BSD or Darwin / MacOS don't have /proc/meminfo). And I was talking about those platforms when I asked that question.

I'm quite new to linux. Sorry.

NP.

Tiny rant: I have not found a working way to turn off write caching, so one use case is when using removable devices (i.e. usb drives), to monitor Dirty so you know when a transfer has ACTUALLY completed. It's a poor user experience, but a way to monitor Dirty at least provides a workaround.

You can always call sync on the command line which will block until all the cached writes up to that moment have completed. For removable media use umount, which will do the sync automatically. For details have a look here

BenBE avatar May 09 '23 05:05 BenBE

@martixy You need to describe what the two meters do, or else we have have no idea what information you would like to monitor. The term "dirty" can mean many things in different computer contexts. Did you mean this? "Dirty: Memory waiting to be written back to disk" And for "write back" did you mean this? "Writeback: Memory which is actively being written back to disk" (https://access.redhat.com/solutions/406773)

Explorer09 avatar May 09 '23 13:05 Explorer09

/proc/meminfo They are the values for the disk cache in RAM.

@Explorer09 Is this not enough?

@BenBE Tnx for the resource.

martixy avatar May 09 '23 15:05 martixy

Tiny rant: I have not found a working way to turn off write caching, so one use case is when using removable devices (i.e. usb drives), to monitor Dirty so you know when a transfer has ACTUALLY completed. It's a poor user experience, but a way to monitor Dirty at least provides a workaround.

Shouldn't you just unmount the filesystem before removing?

OlafvdSpek avatar Dec 27 '23 16:12 OlafvdSpek