Hi Isaac,

yeah I worked with that on Ubuntu already.
It works "the same way as usual" I'd think.

So you can configure it via kernel args like:
  default_hugepagesz=1M hugepagesz=1M hugepages=4 hugepagesz=2G hugepages=1

And later on runtime you can check and modify via sysfs:
$ for f in $(find /sys/devices/system/node/node0/hugepages -type f ); do
printf "%-85s %s\n" "$f" "$(cat $f)"; done
/sys/devices/system/node/node0/hugepages/hugepages-1024kB/nr_hugepages
          4
/sys/devices/system/node/node0/hugepages/hugepages-1024kB/free_hugepages
          4
/sys/devices/system/node/node0/hugepages/hugepages-1024kB/surplus_hugepages
         0
/sys/devices/system/node/node0/hugepages/hugepages-2097152kB/nr_hugepages
           1
/sys/devices/system/node/node0/hugepages/hugepages-2097152kB/free_hugepages
         1
/sys/devices/system/node/node0/hugepages/hugepages-2097152kB/surplus_hugepages
      0

You can then as usual mount and use it.
It will always mount the default size to /dev/hugepages and you can mount
other sizes as needed.

$ sudo mkdir /dev/hugepages2G
$ sudo mount -t hugetlbfs -o pagesize=2G none /dev/hugepages2G
$ mount | grep hugepa
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=1M)
none on /dev/hugepages2G type hugetlbfs (rw,relatime,pagesize=2048M)

I tried that with:
4.15.0-20-generic (Bionic 18.04)
4.13.0-39-generic (Xenial 16.04 available through [1])

Unfortunately the Ubuntu docu at IBM doesn't consider HWE kernels [2].
But for your question essentially what is documented at [3] works for
Ubuntu as well.

[1]: https://wiki.ubuntu.com/Kernel/RollingLTSEnablementStack
[2]:
https://www.ibm.com/support/knowledgecenter/en/linuxonibm/com.ibm.linux.z.ludd/ludd_r_dd_lrgpg.html
[3]:
https://www.ibm.com/support/knowledgecenter/en/linuxonibm/com.ibm.linux.z.lhdd/lhdd_r_largepage_setup.html


On Tue, Apr 24, 2018 at 8:39 PM, Isaac Raschkovsky <isaac.raschkov...@gm.com
> wrote:

> Hi All,
>
>     Did someone try to config HugePages on Ubuntu with more than 1MB?
>
> Thanks,
>
>
>
> Nothing in this message is intended to constitute an electronic signature
> unless a specific statement to the contrary is included in this message.
>
> Confidentiality Note: This message is intended only for the person or
> entity to which it is addressed. It may contain confidential and/or
> privileged material. Any review, transmission, dissemination or other use,
> or taking of any action in reliance upon this message by persons or
> entities other than the intended recipient is prohibited and may be
> unlawful. If you received this message in error, please contact the sender
> and delete it from your computer.
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit
> http://wiki.linuxvm.org/
>



--
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to