diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index f3e204227..395539edf 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -311,6 +311,42 @@ Set up Reference UOS :name: gsg-successful-boot +Device Manager memory allocation mechanism +========================================== + +There are two Device Manager memory allocation mechanisms available: + +- Contiguous Memory Allocator (CMA), and +- Huge Page Tables (HugeTLB). HugeTLB is the default. + +To choose CMA, do the following: + +1) Add ``cma=reserved_mem_size@recommend_memory_offset-0``, (for example + ``cma=2560M@0x100000000-0``) to the SOS cmdline in ``acrn.conf`` + +2) Start ``acrn-dm`` *without* the ``-T`` option + +To support HugeTLB, do the following: + +1) Do huge page reservation + + - For 1G huge page reservation, add ``hugepagesz=1G hugepages=reserved_pg_num`` + (for example, ``hugepagesz=1G hugepages=4``) to the SOS cmdline in + ``acrn.conf`` (for EFI) + + - For 2M huge page reservation, after the SOS starts up, run the + command:: + + echo reserved_pg_num > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + + .. note:: + You can use 2M reserving method to do reservation for 1G page size, but it + may fail. For an EFI platform, you may skip 1G page reservation + by using a 2M page, but make sure your huge page reservation size is + large enough for your usage. + +2) Start ``acrn-dm`` *with* the ``-T`` option. + Build ACRN from Source ********************** diff --git a/doc/primer/index.rst b/doc/primer/index.rst index 7bccec736..7f981b6ab 100644 --- a/doc/primer/index.rst +++ b/doc/primer/index.rst @@ -936,40 +936,3 @@ or .. code-block:: bash screen /dev/pts/0 - - -Device Manager memory allocation mechanism -****************************************** - -There are two Device Manager memory allocation mechanisms available: - -- Contiguous Memory Allocator (CMA), and -- Huge Page Tables (HugeTLB). HugeTLB is the default. - -To choose CMA, do the following: - -1) Add ``cma=reserved_mem_size@recommend_memory_offset-0``, (for example - ``cma=2560M@0x100000000-0``) to the SOS cmdline in ``acrn.conf`` - -2) Start ``acrn-dm`` *without* the ``-T`` option - -To support HugeTLB, do the following: - -1) Do huge page reservation - - - For 1G huge page reservation, add ``hugepagesz=1G hugepages=reserved_pg_num`` - (for example, ``hugepagesz=1G hugepages=4``) to the SOS cmdline in - ``acrn.conf`` (for EFI) - - - For 2M huge page reservation, after the SOS starts up, run the - command:: - - echo reserved_pg_num > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - - .. note:: - You can use 2M reserving method to do reservation for 1G page size, but it - may fail. For an EFI platform, you may skip 1G page reservation - by using a 2M page, but make sure your huge page reservation size is - large enough for your usage. - -2) Start ``acrn-dm`` *with* the ``-T`` option.