From 3e8b423a2cb11f819f3cede7ef817f4012f18944 Mon Sep 17 00:00:00 2001
From: Steve Vinoski
Date: Sun, 26 Jan 2014 20:34:12 -0500
Subject: further enhancements for dirty schedulers
Add support for setting the number of dirty CPU schedulers online via
erlang:system_flag/2. Assuming the emulator is built with dirty schedulers
enabled, the number of dirty CPU schedulers online may not be less than 1,
nor greater than the number of dirty CPU schedulers available, nor greater
than the number of normal schedulers online. Dirty CPU scheduler threads
that are taken offline via system_flag/2 are suspended. The number of dirty
CPU schedulers online may be adjusted independently of the number of normal
schedulers online, but if system_flag/2 is used to set the number of normal
schedulers online to a value less than the current number of normal
schedulers online, the number of dirty CPU schedulers online is decreased
proportionally. Likewise, if the number of normal schedulers online is
increased, the number of dirty CPU schedulers online is increased
proportionally. For example, if 8 normal schedulers and 4 dirty CPU
schedulers are online, and system_flag/2 is called to set the number of
normal schedulers online to 4, the number of dirty CPU schedulers online is
also decreased by half, to 2. Subsequently setting the number of normal
schedulers online back to 8 also sets the number of dirty CPU schedulers
online back to 4. Augment the system_flag/2 documentation in the erlang man
page to explain this relationship between schedulers_online and
dirty_cpu_schedulers_online.
Also ensure that all dirty CPU and I/O schedulers are suspended when
multi-scheduling is blocked via system_flag/2, and brought back online when
multi-scheduling is unblocked.
Add Rickard Green's rewritten check_enqueue_in_prio_queue() function that
inspects process state more thoroughly to determine if to enqueue it and if
so on what queue, including dirty queues when appropriate.
Make sure dirty NIF jobs do not trigger erlang:system_monitor long_schedule
messages.
Add more dirty scheduler testing to the scheduler test suite.
Remove the erts_no_dirty_cpu_schedulers_online global variable, since it's
no longer needed.
Execute dirty NIFs on a normal scheduler thread while multi-scheduling
blocking is in effect. Evacuate any dirty jobs residing in the dirty run
queues over to a normal run queue when multi-scheduling is blocked.
Allow dirty schedulers to execute aux work.
Set the dirty run queues halt_in_progress flag when halting the normal
schedulers.
Change dirty scheduler numbers to a structure including both scheduler
number and type, either dirty CPU or dirty I/O. Add some assertions to
ensure that dirty CPU schedulers operate only on dirty CPU scheduler
process flags, and the same for dirty I/O schedulers.
---
erts/doc/src/erlang.xml | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
(limited to 'erts/doc')
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 4cf5631727..3004acf124 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -5203,9 +5203,16 @@ ok
erlang:system_info(schedulers_online).
Returns the old value of the flag.
- Note that the dirty schedulers functionality is experimental, and
- that you have to enable support for dirty schedulers when building OTP in
- order to try the functionality out.
+ Note that the number of dirty CPU schedulers online may change if the number of
+ schedulers online changes. For example, if there are 12 schedulers and all are
+ online, and 6 dirty CPU schedulers, all online as well, and system_flag/2
+ is used to set the number of schedulers online to 6, then the number of dirty
+ CPU schedulers online is automatically decreased by half as well, down to 3.
+ Similarly, the number of dirty CPU schedulers online increases proportionally
+ to increases in the number of schedulers online.
+ Note that the dirty schedulers functionality is experimental, and
+ that you have to enable support for dirty schedulers when building OTP in order
+ to try out the functionality.
For more information see
erlang:system_info(dirty_cpu_schedulers)
and
@@ -5438,6 +5445,15 @@ ok
.
Returns the old value of the flag.
+ Note that if the emulator was built with support for dirty schedulers,
+ changing the number of schedulers online can also change the number of dirty
+ CPU schedulers online. For example, if there are 12 schedulers and all are
+ online, and 6 dirty CPU schedulers, all online as well, and system_flag/2
+ is used to set the number of schedulers online to 6, then the number of dirty
+ CPU schedulers online is automatically decreased by half as well, down to 3.
+ Similarly, the number of dirty CPU schedulers online increases proportionally
+ to increases in the number of schedulers online.
For more information see,
erlang:system_info(schedulers),
and
@@ -5817,12 +5833,13 @@ ok
boot time and cannot be changed after that. The number of dirty CPU
scheduler threads online can however be changed at any time. The number of
dirty CPU schedulers can be set on startup by passing
- the +SDcpu command line flag, see
- erl(1).
+ the +SDcpu or
+ +SDPcpu command line flags,
+ see erl(1).
Note that the dirty schedulers functionality is experimental, and
that you have to enable support for dirty schedulers when building OTP in
- order to try the functionality out.
+ order to try out the functionality.
See also erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline),
erlang:system_info(dirty_cpu_schedulers_online),
erlang:system_info(dirty_io_schedulers),
@@ -5844,7 +5861,7 @@ ok
Note that the dirty schedulers functionality is experimental, and
that you have to enable support for dirty schedulers when building OTP in
- order to try the functionality out.
+ order to try out the functionality.
For more information, see
erlang:system_info(dirty_cpu_schedulers),
erlang:system_info(dirty_io_schedulers),
@@ -5864,7 +5881,7 @@ ok
Note that the dirty schedulers functionality is experimental, and
that you have to enable support for dirty schedulers when building OTP in
- order to try the functionality out.
+ order to try out the functionality.
For more information, see
erlang:system_info(dirty_cpu_schedulers),
erlang:system_info(dirty_cpu_schedulers_online), and
--
cgit v1.2.3