The default choice in setup_large_page_type() if set -XX:+UseLargePages only

Patrick Zhang OS patrick at os.amperecomputing.com
Thu Jul 18 11:06:06 UTC 2019


I found a weird "issue" when setting up an env with -XX:+UseLargePages only. I knew later on that at least one of UseHugeTLBFS/UseSHM/UseTransparentHugePages, but in the beginning everything worked well without any warnings. The default choice is UseHugeTLBFS behind this. However when I added -XX:-UseTransparentHugePages, the function got completely disabled and setup_large_page_type() returned false. Is this an expected behavior? or any warnings ought to show in console? If -XX:+UseLargePages is allowed to be specified alone, perhaps disabling the default UseHugeTLBFS choice can be less misleading?

Thanks for any comments.


Here is the related source code:
bool os::Linux::setup_large_page_type(size_t page_size)

https://hg.openjdk.java.net/jdk/jdk/file/065142ace8e9/src/hotspot/os/linux/os_linux.cpp#l3764



java -Xmx512m -XX:+PrintFlagsFinal -version (default values)

     bool UseHugeTLBFS                             = false                                     {product} {default}

     bool UseLargePages                            = false                                  {pd product} {default}

     bool UseSHM                                   = false                                     {product} {default}

     bool UseTransparentHugePages                  = false                                     {product} {default}

java -Xmx512m -XX:+PrintFlagsFinal -XX:LargePageSizeInBytes=2m -XX:+UseLargePages -version

     bool UseHugeTLBFS                             = true                                      {product} {command line}

     bool UseLargePages                            = true                                   {pd product} {command line}

     bool UseSHM                                   = false                                     {product} {default}

     bool UseTransparentHugePages                  = false                                     {product} {default}

java -Xmx512m -XX:+PrintFlagsFinal -XX:LargePageSizeInBytes=2m -XX:+UseLargePages -XX:-UseTransparentHugePages -version

     bool UseHugeTLBFS                             = false                                     {product} {command line}

     bool UseLargePages                            = false                                  {pd product} {command line}

     bool UseSHM                                   = false                                     {product} {default}

     bool UseTransparentHugePages                  = false                                     {product} {default}

java -Xmx512m -XX:+PrintFlagsFinal -XX:LargePageSizeInBytes=2m -XX:+UseLargePages -XX:-UseSHM -version

     bool UseHugeTLBFS                             = false                                     {product} {command line}

     bool UseLargePages                            = false                                  {pd product} {command line}

     bool UseSHM                                   = false                                     {product} {default}

     bool UseTransparentHugePages                  = false                                     {product} {default}

Regards
Patrick



More information about the hotspot-dev mailing list