xsos icon indicating copy to clipboard operation
xsos copied to clipboard

Change THP Message when AnonHugePages = 0

Open karlabbott opened this issue 4 years ago • 1 comments

At present you have code that does:

      printf    "  %sTHP:%s\n", H2, H0
      if (Anonhugepages == 0)
        printf  "    THP Disabled\n"
      else {
        printf  "    %s kB allocated to THP %s\n", Anonhugepages, H0
      }

THP can still be enabled without the system having allocated any anonymous huge pages. The proper place to check if THP is enabled or not is:

[root@host ~]# cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never

You could simply report the output of that setting or you could change your existing message from "THP Disabled" to "THP not in use."

At any rate, the code as it stands will flag THP disabled even if you have "enabled" set to always or madvise.

Karl

karlabbott avatar Jan 13 '21 19:01 karlabbott

I've changed the message for now, but I would like to make this more accurate in the future.

Thanks for the clear description!

superjamie avatar Feb 03 '21 07:02 superjamie