Skip to content

numa,sched,mm: pseudo-interleaving for automatic NUMA balancing

[email protected] linux-mm lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest9 patches 3 repliesIn review
  2. v49 patches 6 repliesSuperseded
  3. v36 patches 11 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v27 patches11 repliesSuperseded
v16 patches4 repliesSuperseded

Changes in v5 from the cover letter

- remove some code that did not help performance
- implement all the cleanups suggested by Mel Gorman
- lots more testing, by Chegu Vinod and myself
- rebase against -tip instead of -next, to make merging easier

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9numa,sched,mm: remove p->numa_migrate_deferredDocumentation/sysctl/kernel.txt include/linux/sched.h kernel/sched/fair.c +2 more+1 -700 replies
2/9rename p->numa_faults to numa_faults_memoryinclude/linux/sched.h kernel/sched/core.c kernel/sched/debug.c +1 more+37 -370 replies
3/9numa,sched: track from which nodes NUMA faults are triggeredinclude/linux/sched.h kernel/sched/fair.c+30 -90 replies
4/9numa,sched: build per numa_group active node mask from numa_faults_cpu statisticskernel/sched/fair.c+42 -00 replies
5/9numa,sched,mm: use active_nodes nodemask to limit numa migrationsinclude/linux/sched.h kernel/sched/fair.c mm/mempolicy.c+71 -281 reply
6/9numa,sched: normalize faults_cpu stats and weigh by CPU useinclude/linux/sched.h kernel/sched/core.c kernel/sched/fair.c+55 -21 reply
7/9numa,sched: do statistics calculation using local variables onlykernel/sched/fair.c+4 -80 replies
8/9numa,sched: rename variables in task_numa_faultkernel/sched/fair.c+4 -40 replies
9/9numa,sched: turn some magic numbers into defineskernel/sched/fair.c+25 -90 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMel GormanChegu Vinod
SeriesA-b
1/9A-b
2/9A-b
3/9A-b
4/9A-b
5/9A-b
6/9A-b
7/9A-b
8/9A-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/9] numa,sched,mm: pseudo-interleaving for automatic NUMA balancing

The current automatic NUMA balancing code base has issues with workloads that do not fit on one NUMA load. Page migration is slowed down, but memory distribution between the nodes where the workload runs is essentially random, often resulting in a suboptimal amount of memory bandwidth being available to the workload.

In order to maximize performance of workloads that do not fit in one NUMA node, we want to satisfy the following criteria:
1) keep private memory local to each thread
2) avoid excessive NUMA migration of pages
3) distribute shared memory across the active nodes, to maximize memory bandwidth available to the workload

This patch series identifies the NUMA nodes on which the workload is actively running, and balances (somewhat lazily) the memory between those nodes, satisfying the criteria above.

As usual, the series has had some performance testing, but it could always benefit from more testing, on other systems.

Changes since v4:
- remove some code that did not help performance
- implement all the cleanups suggested by Mel Gorman
- lots more testing, by Chegu Vinod and myself
- rebase against -tip instead of -next, to make merging easier
Changes since v3:
- various code cleanups suggested by Mel Gorman (some in their own patches)
- after some testing, switch back to the NUMA specific CPU use stats, since that results in a 1% performance increase for two 8-warehouse specjbb instances on a 4-node system, and reduced page migration across the board
Changes since v2:
- dropped tracepoint (for now?)
- implement obvious improvements suggested by Peter
- use the scheduler maintained CPU use statistics, drop
the NUMA specific ones for now. We can add those later
if they turn out to be beneficial
Changes since v1:
- fix divide by zero found by Chegu Vinod
- improve comment, as suggested by Peter Zijlstra
- do stats calculations in task_numa_placement in local variables

Some performance numbers, with two 40-warehouse specjbb instances on an 8 node system with 10 CPU cores per node, using a pre-cleanup version of these patches, courtesy of Chegu Vinod:

numactl manual pinning

spec1.txt:           throughput =     755900.20 SPECjbb2005 bops
spec2.txt:           throughput =     754914.40 SPECjbb2005 bops

NO-pinning results (Automatic NUMA balancing, with patches)

spec1.txt:           throughput =     706439.84 SPECjbb2005 bops
spec2.txt:           throughput =     729347.75 SPECjbb2005 bops

NO-pinning results (Automatic NUMA balancing, without patches)

spec1.txt:           throughput =     667988.47 SPECjbb2005 bops
spec2.txt:           throughput =     638220.45 SPECjbb2005 bops

No Automatic NUMA and NO-pinning results

spec1.txt:           throughput =     544120.97 SPECjbb2005 bops
spec2.txt:           throughput =     453553.41 SPECjbb2005 bops