Re: [PATCH] x86/mm: Tracking linear mapping split events since boot

Dave Hansen
2021-01-26T10:22:13Z

On 1/25/21 12:32 PM, Tejun Heo wrote:
> On Mon, Jan 25, 2021 at 12:15:51PM -0800, Dave Hansen wrote:
>>> DirectMap4k: 3505112 kB
>>> DirectMap2M: 19464192 kB
>>> DirectMap1G: 12582912 kB
>>> DirectMap2MSplits: 1705
>>> DirectMap1GSplits: 20
>> This seems much more like something we'd want in /proc/vmstat or as a
>> tracepoint than meminfo. A tracepoint would be especially nice because
>> the trace buffer could actually be examined if an admin finds an
>> excessive number of these.
> Adding a TP sure can be helpful but I'm not sure how that'd make counters
> unnecessary given that the accumulated number of events since boot is what
> matters.

Kinda. The thing that *REALLY* matters is how many of these splits were
avoidable and *could* be coalesced.

The patch here does not actually separate out pre-boot from post-boot,
so it's pretty hard to tell if the splits came from something like
tracing which is totally unnecessary or they were the result of
something at boot that we can't do anything about.

This would be a lot more useful if you could reset the counters. Then
just reset them from userspace at boot. Adding read-write debugfs
exports for these should be pretty trivial.