High performance C++ framework for concurrent servers
Public Types | Public Member Functions | Public Attributes | List of all members
seastar::smp_options Struct Reference

Detailed Description

Configuration for the multicore aspect of seastar.

#include <seastar/core/smp_options.hh>

Inheritance diagram for seastar::smp_options:

Public Types

using value_list_type = boost::intrusive::list< basic_value, boost::intrusive::base_hook< list_base_hook >, boost::intrusive::constant_time_size< false > >
using option_group_list_type = boost::intrusive::list< option_group, boost::intrusive::base_hook< list_base_hook >, boost::intrusive::constant_time_size< false > >

Public Member Functions

 smp_options (program_options::option_group *parent_group)
 operator bool () const
 Does the option group has any values contained in it?
bool used () const
const std::string & name () const
const value_list_type & values () const
value_list_type & values ()
void describe (options_descriptor &descriptor) const
void mutate (options_mutator &mutator)

Public Attributes

program_options::value< unsigned > smp
 Number of threads (default: one per CPU).
program_options::value< resource::cpuset > cpuset
 CPUs to use (in cpuset(7) format; default: all)).
program_options::value< std::string > memory
 Memory to use, in bytes (ex: 4G) (default: all).
program_options::value< std::string > reserve_memory
 Memory reserved to OS (if memory not specified).
program_options::value< std::string > hugepages
 Path to accessible hugetlbfs mount (typically /dev/hugepages/something).
program_options::value< bool > lock_memory
 Lock all memory (prevents swapping).
program_options::value< bool > thread_affinity
program_options::value< unsigned > num_io_groups
 Number of IO groups. More...
program_options::value< std::string > io_properties_file
 Path to a YAML file describing the characteristics of the I/O Subsystem.
program_options::value< std::string > io_properties
 A YAML string describing the characteristics of the I/O Subsystem.
program_options::value< bool > mbind
program_options::value< bool > enable_glibc_exception_scaling_workaround
program_options::value< bool > allow_cpus_in_remote_numa_nodes
seastar::memory_allocator memory_allocator = memory_allocator::seastar

Member Function Documentation

◆ describe()

void seastar::program_options::option_group::describe ( options_descriptor descriptor) const

Describe the content of this option group to the visitor.

The content is visited in a depth-first manner:

  • First the option groups itself is visited with options_descriptor::visit_group_start(). If this returns false the entire content of the group, including all its subgroups and values are skipped and options_descriptor::visit_group_end() is called immediately. Otherwise visiting the content of the group proceeds.
  • All the values contained therein are visited. For each value the following happens:
    • First options_descriptor::visit_value_metadata() is called with generic metadata that all values have. If this return false the value is skipped, otherwise visiting the value proceeds.
    • Then the appropriate overload of options_descriptor::visit_value() is called, with a pointer to the default value of the respective value. The pointer is null if there is no default value.
    • For selection_value, options_descriptor::visit_selection_value() will be called instead of options_descriptor::visit_value(). After the value is visited, the option_group instance belonging to each candidate (if set) will be visited.
  • All the nested option_group instances in the current group are visited.
  • Finally options_descriptor::visit_group_end() is called.

◆ mutate()

void seastar::program_options::option_group::mutate ( options_mutator mutator)

Mutate the content of this option group by the visitor.

The visiting algorithm is identical to that of describe(), with the following differences:

  • options_mutator::visit_value() is allowed to mutate the value through the passed-in reference. It should return true if it did so and false otherwise.
  • When visiting a selection value, only the nested group belonging to the selected value is visited afterwards.

Member Data Documentation

◆ allow_cpus_in_remote_numa_nodes

program_options::value<bool> seastar::smp_options::allow_cpus_in_remote_numa_nodes

If some CPUs are found not to have any local NUMA nodes, allow assigning them to remote ones.

Unused when seastar is compiled without HWLOC support.

◆ enable_glibc_exception_scaling_workaround

program_options::value<bool> seastar::smp_options::enable_glibc_exception_scaling_workaround

Enable workaround for glibc/gcc c++ exception scalablity problem.

Default: true.

Unused when seastar is compiled without the exception scaling support.

◆ mbind

program_options::value<bool> seastar::smp_options::mbind

Enable mbind.

Default: true.

◆ memory_allocator

seastar::memory_allocator seastar::smp_options::memory_allocator = memory_allocator::seastar

◆ num_io_groups

program_options::value<unsigned> seastar::smp_options::num_io_groups

Number of IO groups.

Each IO group will be responsible for a fraction of the IO requests. Defaults to the number of NUMA nodes

Unused when seastar is compiled without HWLOC support.

◆ thread_affinity

program_options::value<bool> seastar::smp_options::thread_affinity

Pin threads to their cpus (disable for overprovisioning).

Default: true.

The documentation for this struct was generated from the following file: