On Tue, Jan 24, 2023 at 7:54 AM Ricardo Koller <ricarkol@xxxxxxxxxx> wrote: > > On Mon, Jan 23, 2023 at 10:41:18AM -0800, David Matlack wrote: > > > > Ricardo, if you're interested in adding page size stats to KVM/ARM ahead > > of the Common MMU, e.g. to test eager page splitting, let me know. > > Sure, I can do that. Sounds pretty useful too. > > > I > > want to make sure we align on the userspace-visible stat names to avoid > > churn down the road. Specifically, do we want to expose neutral names > > like pages_{pte,pmd,pud} or expand the KVM/x86 list to include all of > > ARM's possible pages sizes like pages_{4k,16k,64k,...} (or both)? > > I would prefer the latter, mainly to match the x86 names: > > + stats->pages_4k = vm_get_stat(vm, "pages_4k"); > + stats->pages_2m = vm_get_stat(vm, "pages_2m"); > + stats->pages_1g = vm_get_stat(vm, "pages_1g"); > (from this patch) We can always add pages_{pte,pmd,pud} to x86 as aliases of the existing stats. The series I recently sent out to allow custom names for stats [1] would make adding the aliases trivial actually. [1] https://lore.kernel.org/kvm/20230118175300.790835-1-dmatlack@xxxxxxxxxx/ > > but pages_{pte,pmd,pud} would certainly make this test simpler > as it would handle all guest page sizes: > > + stats->pages_pte = vm_get_stat(vm, "pages_pte"); > Yeah pages_{pte,pmd,pud} would certainly make the test simpler. At this point I'm leaning toward pages_{pte,pmd,pud} to unblock this testing in an architecture neutral way, and we can add pages_{4k,16k,...} to ARM in the future using aliases.