Skip to content

Commit

Permalink
[runtime_tools,erts] Remove erts_alloc_config
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard-green committed Apr 6, 2023
1 parent 3ae5bd2 commit d9410ff
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 1,176 deletions.
Binary file modified bootstrap/lib/stdlib/ebin/otp_internal.beam
Binary file not shown.
20 changes: 0 additions & 20 deletions erts/doc/src/erts_alloc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -832,18 +832,6 @@
<p>Configures all allocators as they were configured in respective
Erlang/OTP release. These will eventually be removed.</p>
</item>
<tag><c>config</c></tag>
<item>
<p>Disables features that cannot be enabled while creating an
allocator configuration with
<seeerl marker="runtime_tools:erts_alloc_config">
<c>erts_alloc_config(3)</c></seeerl>.</p>
<note>
<p>This option is to be used only while running
<c>erts_alloc_config(3)</c>, <em>not</em> when
using the created configuration.</p>
</note>
</item>
</taglist>
</item>
<tag><marker id="Mlpm"/><c>+Mlpm all|no</c></tag>
Expand Down Expand Up @@ -899,20 +887,12 @@
<p><c>erts_alloc</c> is not obliged to strictly use the settings that
have been passed to it (it can even ignore them).</p>
</note>

<p>The <seeerl marker="runtime_tools:erts_alloc_config">
<c>erts_alloc_config(3)</c></seeerl>
tool can be used to aid creation of an
<c>erts_alloc</c> configuration that is suitable for a limited
number of runtime scenarios.</p>
</section>

<section>
<title>See Also</title>
<p><seecom marker="erl"><c>erl(1)</c></seecom>,
<seeerl marker="erlang"><c>erlang(3)</c></seeerl>,
<seeerl marker="runtime_tools:erts_alloc_config">
<c>erts_alloc_config(3)</c></seeerl>,
<seeerl marker="runtime_tools:instrument">
<c>instrument(3)</c></seeerl></p>
</section>
Expand Down
43 changes: 0 additions & 43 deletions erts/emulator/beam/erl_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ struct au_init {
}

typedef struct {
int erts_alloc_config;
#if HAVE_ERTS_MSEG
ErtsMsegInit_t mseg;
#endif
Expand Down Expand Up @@ -607,7 +606,6 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
UWord extra_block_size = 0;
int i, ncpu;
erts_alc_hndl_args_init_t init = {
0,
#if HAVE_ERTS_MSEG
ERTS_MSEG_INIT_DEFAULT_INITIALIZER,
#endif
Expand Down Expand Up @@ -709,44 +707,6 @@ erts_alloc_init(int *argc, char **argv, ErtsAllocInitOpts *eaiop)
adjust_carrier_migration_support(&init.fix_alloc);
adjust_carrier_migration_support(&init.literal_alloc);

if (init.erts_alloc_config) {
/* Adjust flags that erts_alloc_config won't like */

/* No thread specific instances */
init.temp_alloc.thr_spec = 0;
init.sl_alloc.thr_spec = 0;
init.std_alloc.thr_spec = 0;
init.ll_alloc.thr_spec = 0;
init.eheap_alloc.thr_spec = 0;
init.binary_alloc.thr_spec = 0;
init.ets_alloc.thr_spec = 0;
init.driver_alloc.thr_spec = 0;
init.fix_alloc.thr_spec = 0;
init.literal_alloc.thr_spec = 0;

/* No carrier migration */
init.temp_alloc.init.util.acul = 0;
init.sl_alloc.init.util.acul = 0;
init.std_alloc.init.util.acul = 0;
init.ll_alloc.init.util.acul = 0;
init.eheap_alloc.init.util.acul = 0;
init.binary_alloc.init.util.acul = 0;
init.ets_alloc.init.util.acul = 0;
init.driver_alloc.init.util.acul = 0;
init.fix_alloc.init.util.acul = 0;
init.literal_alloc.init.util.acul = 0;
init.temp_alloc.init.util.acful = 0;
init.sl_alloc.init.util.acful = 0;
init.std_alloc.init.util.acful = 0;
init.ll_alloc.init.util.acful = 0;
init.eheap_alloc.init.util.acful = 0;
init.binary_alloc.init.util.acful = 0;
init.ets_alloc.init.util.acful = 0;
init.driver_alloc.init.util.acful = 0;
init.fix_alloc.init.util.acful = 0;
init.literal_alloc.init.util.acful = 0;
}

/* Only temp_alloc can use thread specific interface */
if (init.temp_alloc.thr_spec)
init.temp_alloc.thr_spec = erts_no_schedulers + init.dirty_alloc_insts;
Expand Down Expand Up @@ -1736,9 +1696,6 @@ handle_args(int *argc, char **argv, erts_alc_hndl_args_init_t *init)
for (a = 0; a < aui_sz; a++)
aui[a]->enable = 1;
}
else if (sys_strcmp("config", arg) == 0) {
init->erts_alloc_config = 1;
}
else if (sys_strcmp("r9c", arg) == 0
|| sys_strcmp("r10b", arg) == 0
|| sys_strcmp("r11b", arg) == 0) {
Expand Down
3 changes: 1 addition & 2 deletions lib/runtime_tools/doc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ XML_APPLICATION_FILES = ref_man.xml
XML_REF3_FILES = \
dbg.xml \
dyntrace.xml \
erts_alloc_config.xml \
instrument.xml \
system_information.xml \
msacc.xml \
scheduler.xml
XML_REF6_FILES = runtime_tools_app.xml

XML_PART_FILES = part.xml
XML_CHAPTER_FILES = notes.xml LTTng.xml
XML_CHAPTER_FILES = notes.xml LTTng.xml erts_alloc_config.xml

GENERATED_XML_FILES = DTRACE.xml SYSTEMTAP.xml

Expand Down
197 changes: 13 additions & 184 deletions lib/runtime_tools/doc/src/erts_alloc_config.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<erlref>
<chapter>
<header>
<copyright>
<year>2007</year><year>2022</year>
<year>2007</year><year>2023</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
Expand All @@ -25,188 +25,17 @@
<title>erts_alloc_config</title>
<prepared>Rickard Green</prepared>
<docno>1</docno>
<date>07-05-30</date>
<rev>1</rev>
<file>erts_alloc_config.sgml</file>
<date>23-04-06</date>
<rev>2</rev>
<file>erts_alloc_config.xml</file>
</header>
<module since="">erts_alloc_config</module>
<modulesummary>Configuration tool for erts_alloc</modulesummary>
<description>
<warning>
<p>This (experimental) tool no longer produces good configurations and
cannot be fixed in a reasonably backwards compatible manner. It has
therefore been scheduled for removal in <c>OTP 26.0</c>.</p>
</warning>
<p><seecref marker="erts:erts_alloc">erts_alloc(3)</seecref> is an
Erlang Run-Time System internal memory allocator library.
<c>erts_alloc_config</c> is intended to be used to aid creation
of an <seecref marker="erts:erts_alloc">erts_alloc(3)</seecref>
configuration that is suitable for a limited number of runtime
scenarios. The configuration that <c>erts_alloc_config</c>
produce is intended as a suggestion, and may need to be
adjusted manually.</p>
<p>The configuration is created based on information about a number
of runtime scenarios. It is obviously impossible to foresee every
runtime scenario that can occur. The important scenarios are
those that cause maximum or minimum load on specific memory
allocators. Load in this context is total size of memory blocks
allocated.</p>
<p>The current implementation of <c>erts_alloc_config</c> concentrate
on configuration of multi-block carriers. Information gathered
when a runtime scenario is saved is mainly current and maximum use
of multi-block carriers. If a parameter that change the use of
multi-block carriers is changed, a previously generated
configuration is invalid and <c>erts_alloc_config</c> needs
to be run again. It is mainly the single block carrier threshold
that effects the use of multi-block carriers, but other
single-block carrier parameters might as well. If another value of
a single block carrier parameter than the default is desired, use
the desired value when running <c>erts_alloc_config</c>.</p>
<p>A configuration is created in the following way:</p>
<list type="bulleted">
<item>
<p>Pass the <seecref marker="erts:erts_alloc#Mea">+Mea config</seecref>
command-line flag to the Erlang runtime system you are going
to use for creation of the allocator configuration. It will
disable features that prevent <c>erts_alloc_config</c> from
doing its job. Note, you should <em>not</em> use this flag
when using the created configuration. Also note that it is
important that you use the same
<seecom marker="erts:erl#+S">amount of schedulers</seecom>
when creating the configuration as you are going the use on
the system using the configuration.</p>
</item>
<item>
<p>Run your applications with different scenarios (the more
the better) and save information about each scenario by calling
<seemfa marker="#save_scenario/0">save_scenario/0</seemfa>.
It may be hard to know when the applications are at an (for
<c>erts_alloc_config</c>) important runtime scenario. A good
approach may therefore be to call
<seemfa marker="#save_scenario/0">save_scenario/0</seemfa>
repeatedly, e.g. once every tenth second. Note that it is
important that your applications reach the runtime scenarios
that are important for <c>erts_alloc_config</c> when you are
saving scenarios; otherwise, the configuration may perform
bad.</p>
</item>
<item>
<p>When you have covered all scenarios, call
<seemfa marker="#make_config/1">make_config/1</seemfa>
in order to create a configuration. The configuration is
written to a file that you have chosen. This configuration
file can later be read by an Erlang runtime-system at
startup. Pass the command line argument
<seecom marker="erts:erl#args_file">-args_file FileName</seecom>
to the <seecom marker="erts:erl">erl(1)</seecom> command.</p>
</item>
<item>
<p>The configuration produced by <c>erts_alloc_config</c> may
need to be manually adjusted as already stated. Do not modify the
file produced by <c>erts_alloc_config</c>; instead, put your
modifications in another file and load this file after the
file produced by <c>erts_alloc_config</c>. That is, put the
<seecom marker="erts:erl#args_file">-args_file FileName</seecom>
argument that reads your modification file later on the
command-line than the
<seecom marker="erts:erl#args_file">-args_file FileName</seecom>
argument that reads the configuration file produced by
<c>erts_alloc_config</c>. If a memory allocation parameter
appear multiple times, the last version of will be used, i.e.,
you can override parameters in the configuration file produced
by <c>erts_alloc_config</c>. Doing it this way simplifies
things when you want to rerun <c>erts_alloc_config</c>.</p>
</item>
</list>
<note>
<p>The configuration created by <c>erts_alloc_config</c> may
perform bad, ever horrible, for runtime scenarios that are very
different from the ones saved when creating the
configuration. You are, therefore, advised to rerun
<c>erts_alloc_config</c> if the applications run when the
configuration was made are changed, or if the load on the
applications have changed since the configuration was made. You
are also advised to rerun <c>erts_alloc_config</c> if the Erlang
runtime system used is changed.</p>
</note>
<p><c>erts_alloc_config</c> saves information about runtime scenarios
and performs computations in a server that is automatically
started. The server register itself under the name
<c>'__erts_alloc_config__'</c>.</p>
</description>
<funcs>
<func>
<name since="">save_scenario() -> ok | {error, Error}</name>
<fsummary>Saves information about current runtime scenario</fsummary>
<type>
<v>Error = term()</v>
</type>
<desc>
<p><c>save_scenario/0</c> saves information about the current
runtime scenario. This information will later be used when
<seemfa marker="#make_config/0">make_config/0</seemfa>,
or <seemfa marker="#make_config/1">make_config/1</seemfa>
is called.</p>
<p>The first time <c>save_scenario/0</c> is called a server
will be started. This server will save runtime scenarios. All
saved scenarios can be removed by calling
<seemfa marker="#make_config/0">stop/0</seemfa>.</p>
</desc>
</func>
<func>
<name since="">make_config() -> ok | {error, Error}</name>
<fsummary>Creates an erts_alloc configuration</fsummary>
<type>
<v>Error = term()</v>
</type>
<desc>
<p>This is the same as calling
<seemfa marker="#make_config/1">make_config(group_leader())</seemfa>.</p>
</desc>
</func>
<func>
<name since="">make_config(FileNameOrIODev) -> ok | {error, Error}</name>
<fsummary>Creates an erts_alloc configuration</fsummary>
<type>
<v>FileNameOrIODev = string() | io_device()</v>
<v>Error = term()</v>
</type>
<desc>
<p><c>make_config/1</c> uses the information previously saved by
<seemfa marker="#save_scenario/0">save_scenario/0</seemfa>
in order to produce an <c>erts_alloc</c> configuration. At
least one scenario have had to be saved. All scenarios
previously saved will be used when creating the
configuration. </p>
<p>If <c>FileNameOrIODev</c> is a <c>string()</c>,
<c>make_config/1</c> will use <c>FileNameOrIODev</c> as a
filename. A file named <c>FileNameOrIODev</c> is created and
the configuration will be written to that file. If
<c>FileNameOrIODev</c> is an
<seeerl marker="stdlib:io">io_device()</seeerl> (see the
documentation of the module
<seeerl marker="stdlib:io">io</seeerl>), the configuration
will be written to the io device.</p>
</desc>
</func>
<func>
<name since="">stop() -> ok | {error, Error}</name>
<fsummary></fsummary>
<type>
<v>Error = term()</v>
</type>
<desc>
<p>Stops the server that saves runtime scenarios.</p>
</desc>
</func>
</funcs>

<section>
<title>See Also</title>
<p><seecref marker="erts:erts_alloc">erts_alloc(3)</seecref>,
<seecom marker="erts:erl">erl(1)</seecom>,
<seeerl marker="stdlib:io">io(3)</seeerl></p>
<section><title>Module Removed</title>
<warning>
<p>This (experimental) tool no longer produced good configurations and
cannot be fixed in a reasonably backwards compatible manner. It has
therefore as of OTP 26.0 been removed.</p>
</warning>
</section>
</erlref>
</chapter>


1 change: 1 addition & 0 deletions lib/runtime_tools/doc/src/part.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<xi:include href="LTTng.xml"/>
<xi:include href="DTRACE.xml"/>
<xi:include href="SYSTEMTAP.xml"/>
<xi:include href="erts_alloc_config.xml"/>
</part>


Expand Down
1 change: 0 additions & 1 deletion lib/runtime_tools/doc/src/ref_man.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<xi:include href="runtime_tools_app.xml"/>
<xi:include href="dbg.xml"/>
<xi:include href="dyntrace.xml"/>
<xi:include href="erts_alloc_config.xml"/>
<xi:include href="instrument.xml"/>
<xi:include href="msacc.xml"/>
<xi:include href="scheduler.xml"/>
Expand Down
Loading

0 comments on commit d9410ff

Please sign in to comment.