Skip to content

Commit 9a7c8b6

Browse files
leitaoclsotog
authored andcommitted
docs: workqueue: document WQ_AFFN_CACHE_SHARD affinity scope
Update kernel-parameters.txt and workqueue.rst to reflect the new cache_shard affinity scope and the default change from cache to cache_shard. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Tejun Heo <tj@kernel.org> (cherry picked from commit 41e3ccc) Signed-off-by: Carol L Soto <csoto@nvidia.com>
1 parent 5e368f8 commit 9a7c8b6

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8541,7 +8541,8 @@ Kernel parameters
85418541
workqueue.default_affinity_scope=
85428542
Select the default affinity scope to use for unbound
85438543
workqueues. Can be one of "cpu", "smt", "cache",
8544-
"numa" and "system". Default is "cache". For more
8544+
"cache_shard", "numa" and "system". Default is
8545+
"cache_shard". For more
85458546
information, see the Affinity Scopes section in
85468547
Documentation/core-api/workqueue.rst.
85478548

Documentation/core-api/workqueue.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ Affinity Scopes
378378

379379
An unbound workqueue groups CPUs according to its affinity scope to improve
380380
cache locality. For example, if a workqueue is using the default affinity
381-
scope of "cache", it will group CPUs according to last level cache
382-
boundaries. A work item queued on the workqueue will be assigned to a worker
383-
on one of the CPUs which share the last level cache with the issuing CPU.
381+
scope of "cache_shard", it will group CPUs into sub-LLC shards. A work item
382+
queued on the workqueue will be assigned to a worker on one of the CPUs
383+
within the same shard as the issuing CPU.
384384
Once started, the worker may or may not be allowed to move outside the scope
385385
depending on the ``affinity_strict`` setting of the scope.
386386

@@ -402,7 +402,13 @@ Workqueue currently supports the following affinity scopes.
402402
``cache``
403403
CPUs are grouped according to cache boundaries. Which specific cache
404404
boundary is used is determined by the arch code. L3 is used in a lot of
405-
cases. This is the default affinity scope.
405+
cases.
406+
407+
``cache_shard``
408+
CPUs are grouped into sub-LLC shards of at most ``wq_cache_shard_size``
409+
cores (default 8, tunable via the ``workqueue.cache_shard_size`` boot
410+
parameter). Shards are always split on core (SMT group) boundaries.
411+
This is the default affinity scope.
406412

407413
``numa``
408414
CPUs are grouped according to NUMA boundaries.

0 commit comments

Comments
 (0)