Skip to content

Commit 6169a79

Browse files
committed
Move RFC to the supported
Signed-off-by: Isaev, Ilya <[email protected]>
1 parent 0724234 commit 6169a79

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

rfcs/proposed/numa_support/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ See [sub-RFC for increased availability of NUMA API](tbbbind-link-static-hwloc.o
132132

133133
### Create NUMA-constrained arenas
134134

135-
See [sub-RFC for creation of NUMA-constrained arenas](create-numa-arenas.md)
135+
This [sub-proposal is supported](../../supported/numa_support/create-numa-arenas.md).
136136

137137
### NUMA-aware allocation
138138

rfcs/proposed/numa_support/create-numa-arenas.md renamed to rfcs/supported/numa_support/create-numa-arenas.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# API to simplify creation of task arenas constrained to NUMA nodes
22

3-
This sub-RFC proposes an API to ease creation of a one-per-NUMA-node set of task arenas.
3+
This describes describes an API to ease creation of a one-per-NUMA-node set of task arenas.
44

5-
## Introduction
5+
## Motivation
66

7-
The code example in the [overarching RFC for NUMA support](README.md) shows the likely
7+
The code example in the [overarching RFC for NUMA support](../../proposed/numa_support/README.md) shows the likely
88
pattern of using task arenas to distribute computation across all NUMA domains on a system.
99
Let's take a closer look at the part where arenas are created and initialized.
1010

@@ -31,18 +31,18 @@ The default constructor of `task_arena` reserves a slot for an application threa
3131
at the last line explicitly overwrites it to 0 to allow TBB worker threads taking all the slots, however
3232
this nuance might be unknown and easy to miss, potentially resulting in underutilization of CPU resources.
3333
34-
## Proposal
34+
## Implemented API
3535
36-
We propose to introduce a special function to create the set of task arenas, one per NUMA node on the system.
36+
A special function is introduced to create the set of task arenas, one per NUMA node on the system.
3737
The initialization code equivalent to the example above would be:
3838
3939
```c++
4040
std::vector<tbb::task_arena> arenas = tbb::create_numa_task_arenas();
4141
std::vector<tbb::task_group> task_groups(arenas.size());
4242
```
4343

44-
The rest of the code in that example might be rewritten with the API proposed in
45-
[Waiting in a task arena](../task_arena_waiting/readme.md):
44+
The rest of the code in that example might be rewritten with the API for
45+
[waiting in a task arena](../task_arena_waiting/readme.md):
4646

4747
```c++
4848
// enqueue work to all but the first arena, using the task groups to track work
@@ -71,14 +71,14 @@ The function has the following signature:
7171
7272
namespace tbb {
7373
std::vector<tbb::task_arena> create_numa_task_arenas(
74-
task_arena::constraints other_constraints = {},
74+
task_arena::constraints constraints_ = {},
7575
unsigned reserved_slots = 0
7676
};
7777
}
7878
```
7979

8080
It optionally takes a `constraints` argument to change default arena settings such as maximal concurrency
81-
(the upper limit on the number of threads), core type etc.; the `numa_id` value in `other_constraints`
81+
(the upper limit on the number of threads), core type etc.; the `numa_id` value in `constraints_`
8282
is ignored. The second optional argument allows to override the number of reserved slots, which by default
8383
is 0 (unlike the `task_arena` construction default of 1) for the reasons described in the introduction.
8484

@@ -114,7 +114,7 @@ The following critics was provided in the RFC discussion:
114114
115115
- It might be confusing that a single `constraints` object is used to generate multiple arenas,
116116
especially with part of it (`numa_id`) being ignored.
117-
- The proposed API addresses just one, albeit important, use case for creating a set of arenas.
117+
- The API addresses just one, albeit important, use case for creating a set of arenas.
118118
119119
See the "universal function" alternative below for related considerations.
120120
@@ -175,7 +175,7 @@ its downsides:
175175
- It seems very specialized, capable to only address specific and quite narrow set of use cases.
176176
- Arenas are pre-initialized and so could not be adjusted after creation.
177177
178-
Our proposal, instead, aims at a single usability aspect with incremental improvements/extensions
178+
This API, instead, aims at a single usability aspect with incremental improvements/extensions
179179
to the existing oneTBB classes and usage patterns, leaving other aspects to complementary proposals.
180180
Specifically, the [Waiting in a task arena](../task_arena_waiting/readme.md) RFC improves the joint
181181
use of a task arena and a task group to submit and wait for work. Combined, these extensions will
@@ -202,7 +202,7 @@ would serve as a pattern for generating a set of constraints bound to NUMA domai
202202
Using a function to generate arena parameter sets seems even more flexible comparing to a description
203203
language, as that function would be not limited in which parameters to alter, and how.
204204
205-
Compared to the proposal, this approach would necessarily be more verbose because of the need to
205+
This approach would necessarily be more verbose because of the need to
206206
describe or generate a set of constraints. That could however be mitigated for common use cases
207207
with presets provided by the library allowing for a reasonably concise code. For example:
208208
```c++
@@ -215,10 +215,10 @@ extra complexity. As of now, we know just a few arena set patterns with potentia
215215
besides NUMA arenas, we can think of splitting CPU resources by core type and of creating a set of
216216
arenas with different priorities. We do not however recall any requests to simplify these use cases.
217217

218-
## Open questions
218+
## Future Questions
219219
- Instead of a free-standing function in namespace `tbb`, should we consider
220220
a static member function in class `task_arena`?
221-
- The proposal does not consider arena priority, simply keeping the default `priority::normal`.
221+
- At this point arena priority parameter is not considered, simply keeping the default `priority::normal`.
222222
Are there use cases for pre-setting priorities? Similarly for the experimental thread leave policy.
223223
- Are there more practical use cases which could justify the universal function approach?
224224
- Need to consider alternatives to silently ignoring `numa_id` in constraints, such as an exception

test/tbb/test_arena_constraints.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ TEST_CASE("Test reserved slots argument in create_numa_task_arenas") {
114114
auto numa_task_arenas = tbb::create_numa_task_arenas();
115115
if (numa_task_arenas.size() > 1) {
116116
for (auto& ta : numa_task_arenas) {
117-
utils::SpinBarrier barrier {(std::size_t)ta.max_concurrency()};
117+
utils::SpinBarrier barrier {(std::size_t)ta.max_concurrency() + 1};
118118
for (int i = 0; i < ta.max_concurrency(); ++i) {
119119
ta.enqueue([&barrier] { barrier.wait(); });
120120
}
121+
barrier.wait();
121122
}
122123
}
123124

0 commit comments

Comments
 (0)