Skip to content

Commit 41e3ccc

Browse files
leitaohtejun
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 24b2e73 commit 41e3ccc

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
@@ -8519,7 +8519,8 @@ Kernel parameters
85198519
workqueue.default_affinity_scope=
85208520
Select the default affinity scope to use for unbound
85218521
workqueues. Can be one of "cpu", "smt", "cache",
8522-
"numa" and "system". Default is "cache". For more
8522+
"cache_shard", "numa" and "system". Default is
8523+
"cache_shard". For more
85238524
information, see the Affinity Scopes section in
85248525
Documentation/core-api/workqueue.rst.
85258526

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)