Skip to content

Performance-related backports for 4.12.2

Mel Gorman stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26sched/topology: Refactor function build_overlap_sched_groups()kernel/sched/topology.c+43 -190 replies
2/26sched/topology: Fix building of overlapping sched-groupskernel/sched/topology.c+1 -10 replies
3/26sched/topology: Simplify build_overlap_sched_groups()kernel/sched/topology.c+2 -110 replies
4/26sched/debug: Print the scheduler topology group maskkernel/sched/topology.c+11 -10 replies
5/26sched/topology: Verify the first group matches the child domainkernel/sched/topology.c+6 -00 replies
6/26sched/topology: Optimize build_group_mask()kernel/sched/topology.c+2 -20 replies
7/26sched/topology: Move comment about asymmetric node setupskernel/sched/topology.c+10 -90 replies
8/26sched/topology: Remove FORCE_SD_OVERLAPkernel/sched/features.h kernel/sched/topology.c+1 -20 replies
9/26sched/topology: Fix overlapping sched_group_maskkernel/sched/topology.c+17 -10 replies
10/26sched/topology: Small cleanupkernel/sched/core.c kernel/sched/sched.h kernel/sched/topology.c+7 -80 replies
11/26sched/topology: Add sched_group_capacity debuggingkernel/sched/sched.h kernel/sched/topology.c+19 -100 replies
12/26sched/topology: Fix overlapping sched_group_capacitykernel/sched/topology.c+16 -60 replies
13/26sched/topology: Add a few commentskernel/sched/topology.c+193 -70 replies
14/26sched/topology: Rewrite get_group()kernel/sched/topology.c+22 -240 replies
15/26sched/topology: Simplify sched_group_mask() usagekernel/sched/fair.c kernel/sched/topology.c+6 -60 replies
16/26sched/topology: Rename sched_group_mask()kernel/sched/fair.c kernel/sched/sched.h kernel/sched/topology.c+19 -250 replies
17/26sched/topology: Rename sched_group_cpus()kernel/sched/fair.c kernel/sched/sched.h kernel/sched/topology.c+31 -310 replies
18/26vtime, sched/cputime: Remove vtime_account_user()include/linux/vtime.h kernel/sched/cputime.c+7 -140 replies
19/26sched/cputime: Always set tsk->vtime_snap_whence after accounting vtimekernel/sched/cputime.c+1 -10 replies
20/26sched/cputime: Rename vtime fieldsinclude/linux/init_task.h include/linux/sched.h kernel/fork.c +1 more+21 -210 replies
21/26sched/cputime: Move the vtime task fields to their own structinclude/linux/init_task.h include/linux/sched.h kernel/fork.c +1 more+86 -640 replies
22/26sched/cputime: Accumulate vtime on top of nsec clocksourceinclude/linux/sched.h kernel/sched/cputime.c+45 -220 replies
23/26sched/fair: Fix load_balance() affinity redo pathkernel/sched/fair.c+20 -120 replies
24/26percpu_counter: Rename __percpu_counter_add to percpu_counter_add_batchfs/btrfs/disk-io.c fs/btrfs/extent_io.c fs/btrfs/inode.c +8 more+31 -300 replies
25/26writeback: rework wb_[dec|inc]_stat family of functionsfs/fs-writeback.c include/linux/backing-dev.h lib/percpu_counter.c +1 more+18 -310 replies
26/26kernel/fork.c: virtually mapped stacks: do not disable interruptskernel/fork.c+5 -110 replies

Reviews trailers per patch

8 of 26 patches have a Reviewed-by or Acked-by.

PatchRik van RielLauro Ramos VenancioLuiz CapitulinoThomas GleixnerAustin ChristDietmar EggemannTyler BaicarPeter ZijlstraTejun HeoJan Kara
1/26A-b
2/26Debugged-by
3/26
4/26
5/26
6/26
7/26
8/26
9/26Debugged-by
10/26
11/26
12/26Debugged-by
13/26
14/26
15/26
16/26
17/26
18/26A-b T-b R-b
19/26A-b T-b R-b
20/26A-b T-b R-b
21/26A-b T-b R-b
22/26A-b T-b R-b
23/26Co-authored-by Co-authored-by T-b A-b
24/26
25/26A-b R-b
26/26

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 10 reviewers.

Read the v1 thread

Cover letter [PATCH 00/26] Performance-related backports for 4.12.2

This is a second round of performance-related backports based on low-hanging fruit in the 4.13 merge window based on 4.12.2.

As before, these have only been tested on 4.12-stable. While they may merge against older kernels, I have no data on how it behaves and cannot guarantee it's a good idea so I don't recommend it. There will also be some major conflicts that are not trivial to resolve.

For most of the tests I conducted, the impact is marginal but patches the first two sets of patches are important for large machines and for uses of nohz_full. The load balancing patch is fairly specific but measurable. The removal of unnecessary IRQ disabling/enabling is borderline in terms of performance but they are trivial patches and avoiding unnecessary expensive operations is always a plus.

Patches 1-17 resolve a number of topology problems in the scheduler that
primarily impact NUMA machines with a ring topology. There are more patches in there than necessary but one adds very helpful comments on understanding how it works and a few bring the naming of functions in line with 4.13 which makes it a bit easier to follow. Others shuffle comments around and restructure the code which could have been avoided but then the backported patches would not look like their upstream equivalent. While some of the extra patches are outside the scope of -stable, it removes the delta when comparing the 4.12-stable and 4.13 scheduler but I can drop them if necessary.

Performance impact on UMA and fully-connected machines is marginal with minor gains/losses across multiple machines that is mostly within the noise but other reports indicate that the impact on ring topologies is substantial. In particular, the full machine will be properly utilised instead of saturating a subset of nodes for workloads with lots of threads or processes.

Patches 18-22 are more about accounting than performance. The bug is with
workloads running on nohz_full+isolcpus configurations. If 2 or more processes are running on an isolated CPU are 100% userspace bound and normal processes are running on other CPUs then the isolated processes report a mix of userspace and system CPU usage. It can be up to 100% system CPU usage even though in reality there is no time being spent in the kernel. This misaccounting is confusing when analysing workloads.

For normal workloads, there is no measurable difference.

Patch 23 fixes a scheduler load balancing issue where an imbalanced domain
is considered balanced when some tasks are pinned for affinity. Again, for many workloads the impact is marginal but it was a small boost (1-2% barely outside noise) for a specjbb configuration that pinned JVMs. It may be co-incidence but the patch is straight-forward.

Patches 24-25 avoid unnecessary IRQ disable/enable while updating writeback
stats. In many cases this will not be noticable because it happens out-of-band and the cost of stats updates are often negligible compared to the overall cost of writeback. However, unnecessary IRQ disabling is never a good thing and it may be noticable during writeback to ultra-fast storage.

Patches 26 avoids an IRQ disable/enable in the fork path. It's noticable
on fork-intensive workloads with a 1-3% boost on hackbench for example that is just outside the noise.

Signature · 1 line
2.13.1