In some of the EC2 servers of the same type, DirectMap4k can be anywhere between ~100000 kB down to ~50000 kB. How is it set and if it's possible to tune it?
How is `DirectMap4k` set in /proc/meminfo?
kernel;linux kernel;memory;amazon ec2;virtual memory
None of the stuff in /proc/meminfo is anything that's tunable, all of it is just statistics measured by the kernel, and some of it isn't even memory usage.The DirectMap entries in particular are a rough measure of TLB load.  They represent how many pages of each size are mapped in the TLB.  They have nothing to do with actual memory utilization, but can be useful on rare occasion for tracking down performance issues.  This information isn't actually all that useful in most cases, and especially without knowing a lot about your workload.Put a bit differently, this is something you base tuning on, not something you tune, but even then it's not something that's worth worrying about most of the time.