<?xml version="1.0"?>
<!DOCTYPE flagsdescription SYSTEM "http://www.spec.org/dtd/cpuflags2.dtd">

<flagsdescription>

   <filename>Inspur-platform-settings-Amp-v1.1</filename>

   <title>SPEC CPU2017 Platform Settings for Inspur Ampere Platform systems</title>

   <os_tuning>
<![CDATA[
<dl>
<dt><b>cpupower</b></dt> 
 <dd>
  The OS 'cpupower' utility is used to change CPU power governors settings. Available settings are: 
  <ul>
      <li> Performance: Run the CPU at the maximum frequency.</li>      

      <li> powersave(default): Run the CPU at the minimum frequency.</li>

      <li> ondemand: Scales the frequency dynamically according to current load. Jumps to the highest frequency and then possibly back off as the idle time increases.</li>
  </ul>
</dd>

<dt><b>tuned-adm</b>:</dt>
 <dd>
  <p>A commandline interface for switching between different tuning profiles available in supported Linux distributions. The distribution provided profiles are located in /usr/lib/tuned and the user defined profiles in /etc/tuned. To set a profile, one can issue the command "tuned-adm profile (profile_name)". Below are details about some relevant profiles. </p>
  <ul>
   <li><b>throughput-performance</b>: For typical throughput performance tuning. Disables power saving mechanisms and enables sysctl settings that improve the throughput performance of disk and network I/O. CPU governor is set to performance and CPU energy performance bias is set to performance. Disk readahead values are increased.</li>
   <li><b>latency-performance</b>: For low latency performance tuning. Disables power saving mechanisms. CPU governor is set to performance and locked to the low C states. CPU energy performance bias to performance.</li>
   <li><b>balanced</b>: Default profile provides balanced power saving and performance. It enables CPU and disk plugins of tuned and makes the conservative governor is active and also sets the CPU energy performance bias to normal. It also enables power saving on audio and graphics card.</li>
   <li><b>powersave</b>: Maximal power saving for whole system. It sets the CPU governor to ondemand governor and energy performance bias to powersave. It also enable power saving on USB, SATA, audio and graphics card.</li>
  </ul>
 </dd>

<dt><b>kernel.randomize_va_space</b> (ASLR)</dt>
  <dd>
    This setting can be used to select the type of process address space randomization. 
    Defaults differ based on whether the architecture supports ASLR, whether the kernel 
    was built with the CONFIG_COMPAT_BRK option or not, or the kernel boot options used.<br />
    Possible settings:
    <ul>
      <li>0: Turn process address space randomization off.</li>
      <li>1: Randomize addresses of mmap base, stack, and VDSO pages.</li>
      <li>2: Additionally randomize the heap. (This is probably the default.)</li>
    </ul>
    Disabling ASLR can make process execution more deterministic and runtimes more consistent.
    For more information see the <tt>randomize_va_space</tt> entry in the
    <a href="https://www.kernel.org/doc/Documentation/sysctl/kernel.txt">Linux sysctl documentation</a>.
  </dd>

  <dt><b>Transparent Hugepages (THP)</b></dt>
  <dd>
    THP is an abstraction layer that automates most aspects of creating, managing,
    and using huge pages. It is designed to hide much of the complexity in using
    huge pages from system administrators and developers.  Huge pages
    increase the memory page size from 4 kilobytes to 2 megabytes. This provides
    significant performance advantages on systems with highly contended resources
    and large memory workloads. If memory utilization is too high or memory is badly
    fragmented which prevents hugepages being allocated, the kernel will assign
    smaller 4k pages instead. Most recent Linux OS releases have THP enabled by default.<br />
    THP usage is controlled by the sysfs setting <tt>/sys/kernel/mm/transparent_hugepage/enabled</tt>.
    Possible values:
    <ul>
      <li>never: entirely disable THP usage.</li>
      <li>madvise: enable THP usage only inside regions marked MADV_HUGEPAGE using madvise(3).</li>
      <li>always: enable THP usage system-wide. This is the default.</li>
    </ul>
    THP creation is controlled by the sysfs setting <tt>/sys/kernel/mm/transparent_hugepage/defrag</tt>.
    Possible values:
    <ul>
      <li>never: if no THP are available to satisfy a request, do not attempt to make any.</li>
      <li>defer: an allocation requesting THP when none are available get normal pages while requesting THP creation in the background.</li>
      <li>defer+madvise: acts like "always", but only for allocations in regions marked MADV_HUGEPAGE using madvise(3); for all other regions it's like "defer".</li>
      <li>madvise: acts like "always", but only for allocations in regions marked MADV_HUGEPAGE using madvise(3).  This is the default.</li>
      <li>always: an allocation requesting THP when none are available will stall until some are made.</li>
    </ul>
    An application that "always" requests THP often can benefit from waiting for an allocation until those huge pages can be assembled.<br/>
    For more information see the <a href="https://www.kernel.org/doc/Documentation/vm/transhuge.txt">Linux transparent hugepage documentation</a>.
  </dd>
  
    <dt><b>Kernel parameters</b></dt>
        <dd>
          The following Linux Kernel parameters were set for better optimize performance.
          <ul>
            <li>dirty_ratio: Set through "echo 8 > /proc/sys/vm/dirty_ratio". This setting is the absolute maximum amount of system memory 
                that can be filled with dirty pages before everything must get committed to disk.</li>
            <li>swappiness: The swappiness value can range from 1 to 100. A value of 100 will cause the kernel to swap out inactive processes 
                frequently in favor of file system performance, resulting in large disk cache sizes. A value of 1 tells the kernel to only 
                swap processes to disk if absolutely necessary. This can be set through a command like "echo 1 > /proc/sys/vm/swappiness"</li>
            <li>zone_reclaim_mode: Zone reclaim allows the reclaiming of pages from a zone if the number of free pages falls below a watermark 
                even if other zones still have enough pages available. Reclaiming a page can be more beneficial than taking the performance 
                penalties that are associated with allocating a page on a remote zone, especially for NUMA machines. To tell the kernel to 
                free local node memory rather than grabbing free memory from remote nodes, use a command like 
                "echo 1 > /proc/sys/vm/zone_reclaim_mode"</li>
            <li>drop_caches: The command "echo 1> /proc/sys/vm/drop_caches" is used to free up the filesystem page cache.</li>
			<li>numa_balancing: Disabled through "echo 0 > /proc/sys/kernel/numa_balancing". This feature will automatically migrate data on demand so memory nodes are aligned to the local CPU that is accessing data. Depending on the workload involved, enabling this can boost the performance if the workload performs well on NUMA hardware. If the workload is statically set to balance between nodes, then this service may not provide a benefit.</li>
          </ul>
        </dd>
</dl>
]]>
   </os_tuning>


   <firmware>
      <![CDATA[
      <dl>

         <dt><b>ANC mode:</b></dt>
         <dd>Ampere NUMA Control (ANC) specifies the number of desired NUMA (Non-Uniform Memory Access) 
            nodes per chip:
            <ul>
               <li>monolithic: Each physical processor chip is a NUMA node (default)</li>
               <li>hemisphere: Each physical processor chip is two NUMA nodes</li>
               <li>quadrant: Each physical processor chip is four NUMA nodes</li>
            </ul>
            <p>
               Dividing the chip into separate nodes (hemisphere or quadrant) may improve latency to 
               the last level cache and main memory, which may benefit overall performance for NUMA-aware
               operating systems and workloads. 
            </p>

         </dd>

      </dl>

         ]]>
   </firmware>
</flagsdescription>
