Skip to content

Conversation

tuxick
Copy link

@tuxick tuxick commented Aug 11, 2025

ZFS on Linux no longer uses 'p' in arcstats, so kstat-analyzer throws error: arcstats value "p" not found
See More adaptive ARC eviction

I'm not entirely sure about the calculation of mfu_target_size, can someone review this?

@richardelling
Copy link
Owner

Thanks for the contribution! Before we merge, I'd like to be somewhat backwards compatible. This isn't particularly difficult, but probably won't be elegant. I'm thinking of checking for meta and if that exists, use the new code else use the old code. What do you think?

Meanwhile, I'll try to dig up the info on the variables to resolve the open questions.

@richardelling
Copy link
Owner

ok, I think I understand the changes made in the ARC accounting.

c remains the ARC target size.

Previously p represented the MRU/MFU boundary, with p being the target size of the MRU side.

Now, as of March 2023 and commit a8d83e2, the ARC is also split between metadata and data. So now we have a target for the metadata size, meta which shows the boundary between metadata and data. And there is also a separate target for the MRU for metadata pm and data pd

So what is the best way to show this? Let's explore if:

  • Data target size = c - meta
  • Metadata target size = meta
  • Data MRU size = (c - meta) - pd
  • Metadata MRU size = meta - pm

And if that math works, we can report as:

  • ARC target size = c (as-is)
  • Data target size = c - meta as a ratio to c
  • Metadata target size = meta as a ratio to c
  • Data MRU size = pd as a ratio to "Data target size" (c - meta)
  • Metadata MRU size = pm as a ratio to "Metadata target size" (meta)

What do you think?

Reference: openzfs/zfs@a8d83e2#diff-04f1093cc6ee1ece5d6dc700498a8ce9617346e3d2c252f270760103e6ebf399L585

@tuxick
Copy link
Author

tuxick commented Aug 12, 2025

So what is the best way to show this? Let's explore if:

* Data target size = c - meta
* Metadata target size = meta
* Data MRU size = (c - meta) - pd
* Metadata MRU size = meta - pm

This is giving me negative values for MRU:
Target size (GiB) = 4.4
Max target size limit (GiB) = 8.0
Min target size limit (GiB) = 0.500
Data target size (GiB) = 2.9 (66% of target size)
Metadata target size (GiB) = 1.5 (34% of target size)
Data MRU size (GiB) = -0.1 (-4% of data target size)
Metadata MRU size (GiB) = -0.7 (-49% of target size)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants