Date: Fri, 25 Mar 2022 14:06:55 +0100 From: Marko Turk <markoml@markoturk.info> To: freebsd-hackers@freebsd.org Subject: Inactive vs ZFS ARC memory priority Message-ID: <Yj2%2Bb5SeXa7eub8%2B@vps.markoturk.info>
next in thread | raw e-mail | index | archive | help
--bXArPL3y0jOtpkLG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I have a workstation with 32GB or RAM, running recent 12.3-STABLE. vfs.zfs.arc_max is set to "16G". After a few hours of uptime I get this memory usage: Mem: 327M Active, 3007M Inact, 58M Laundry, 20G Wired, 7986M Free ARC: 15G Total, 1723M MFU, 12G MRU, 9032K Anon, 246M Header, 987M Other 13G Compressed, 31G Uncompressed, 2.44:1 Ratio Swap: 4096M Total, 4096M Free All looks good, ZFS ARC is used almost completely up to arc_max. And it stays like this for days. Then I do a make buildworld & buildkernel. And I get this: Mem: 663M Active, 20G Inact, 879M Laundry, 8560M Wired, 1445M Free ARC: 4351M Total, 984M MFU, 2176M MRU, 14M Anon, 37M Header, 1140M Other 2453M Compressed, 5405M Uncompressed, 2.20:1 Ratio Swap: 4096M Total, 4096M Free A lot of memory is in Inactive, and ARC decreased. I think this is still OK. But what I expect to happen eventually is that ARC will grow again and push old data from Inactive. This never happens. I can leave it for days with a lot of disk activity and nothing changes. Seems like old data in Inactive has higher priority than ARC. Why is that so? Can I improve this somehow? If I do something memory intesive, Inacive will decrease. This works as expected, I get something like this: Mem: 659M Active, 16G Inact, 851M Laundry, 9337M Wired, 4343M Free ARC: 5144M Total, 1207M MFU, 2712M MRU, 7275K Anon, 82M Header, 1135M Other 2885M Compressed, 6647M Uncompressed, 2.30:1 Ratio Swap: 4096M Total, 4096M Free After that the ARC will grow and fill the empty memory. But on it's own it will never push Inactive down. Why is old data in Inactive higher priority than new data in ARC? Regards, Marko --bXArPL3y0jOtpkLG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEhGJv+o0FoHlUFxVJ0ArzBirlGugFAmI9vm4ACgkQ0ArzBirl GugvwQ//fVxQFFpUE9fV0xS1GcwB67vveJvslHTl/pfGRUXJP8AiURNNP9x0nRwI howvNB4/yVxnOCYphQPORN+NQP9Y42+/ga7ZLyQMZ4AgmprjWQyQaY0LUWDQ56dA SZSZPevFGVSblL2tyecmC0usWFV7aT3Hyy0NxmShwxs2d+UC1muWK3zRuGeYcrvq QW7vcKUMtpEXKhoU8+8wT5YqueaezadDq44rEdxBSba1sIFEOxZITsAlMqljiOoY R03dOashQ4SROzNKnfnTX054OwDQMBdSROP00Vg4VpNHzcbE9WLxZ+IiPg8da+Ha MQTIjJJB9rhF3Xy3MvEzkb3LqEJsADOMA1iaFPaF+iNGsiH1fAhRy1/4BHzu7U42 ACqs+eYhdEoSqZqW4pHPPEr1IDw/ADfF/zREK1CT+of4vInDOq1DDbsivK4OT/K8 GMlWIwjPvJ2FSm4UYmxsI95Uz/FVdYf/1qILFEwK3ixm2/GXcSzW1V5OfZWvXkyF 073zGFMOmQbevunjHplRwH6cqtunhoY6UAnYVI4vVCTxqABnEIkr2yJQhu5Ia4EY bUtyzcZhvynkOwushG7Q+1EbVtaocCIxivv6GN8rwznT8qf2JrzRW3hYtUp54deA 7wMrwmFrw3qMudViORovtSYkkONWFMrmOY5B3R7Up6bWm1ghFM8= =k1mG -----END PGP SIGNATURE----- --bXArPL3y0jOtpkLG--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Yj2%2Bb5SeXa7eub8%2B>