Commit 1ed1328
committed
sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem
Note: This commit was originally committed as d59cfc0 but got
reverted by 0c98625 due to the performance regression from
the percpu_rwsem write down/up operations added to cgroup task
migration path. percpu_rwsem changes which alleviate the
performance issue are pending for v4.4-rc1 merge window.
Re-apply.
The cgroup side of threadgroup locking uses signal_struct->group_rwsem
to synchronize against threadgroup changes. This per-process rwsem
adds small overhead to thread creation, exit and exec paths, forces
cgroup code paths to do lock-verify-unlock-retry dance in a couple
places and makes it impossible to atomically perform operations across
multiple processes.
This patch replaces signal_struct->group_rwsem with a global
percpu_rwsem cgroup_threadgroup_rwsem which is cheaper on the reader
side and contained in cgroups proper. This patch converts one-to-one.
This does make writer side heavier and lower the granularity; however,
cgroup process migration is a fairly cold path, we do want to optimize
thread operations over it and cgroup migration operations don't take
enough time for the lower granularity to matter.
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/g/55F8097A.7000206@de.ibm.com
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>1 parent 0c98625 commit 1ed1328
File tree
5 files changed
+45
-83
lines changed- include/linux
- kernel
5 files changed
+45
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
477 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
478 | 501 | | |
479 | 502 | | |
480 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 28 | | |
36 | 29 | | |
37 | 30 | | |
| |||
64 | 57 | | |
65 | 58 | | |
66 | 59 | | |
67 | | - | |
68 | 60 | | |
69 | 61 | | |
70 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | 765 | | |
778 | 766 | | |
779 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | 877 | | |
917 | 878 | | |
918 | 879 | | |
| |||
2113 | 2074 | | |
2114 | 2075 | | |
2115 | 2076 | | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
2119 | 2080 | | |
2120 | 2081 | | |
2121 | 2082 | | |
| |||
2172 | 2133 | | |
2173 | 2134 | | |
2174 | 2135 | | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
2178 | | - | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
2179 | 2141 | | |
2180 | 2142 | | |
2181 | 2143 | | |
| |||
2278 | 2240 | | |
2279 | 2241 | | |
2280 | 2242 | | |
2281 | | - | |
| 2243 | + | |
2282 | 2244 | | |
2283 | 2245 | | |
2284 | 2246 | | |
| |||
2406 | 2368 | | |
2407 | 2369 | | |
2408 | 2370 | | |
2409 | | - | |
| 2371 | + | |
2410 | 2372 | | |
2411 | 2373 | | |
2412 | 2374 | | |
| |||
2528 | 2490 | | |
2529 | 2491 | | |
2530 | 2492 | | |
2531 | | - | |
| 2493 | + | |
2532 | 2494 | | |
2533 | 2495 | | |
2534 | 2496 | | |
| |||
2538 | 2500 | | |
2539 | 2501 | | |
2540 | 2502 | | |
2541 | | - | |
| 2503 | + | |
2542 | 2504 | | |
2543 | 2505 | | |
2544 | 2506 | | |
| |||
2548 | 2510 | | |
2549 | 2511 | | |
2550 | 2512 | | |
2551 | | - | |
| 2513 | + | |
2552 | 2514 | | |
2553 | 2515 | | |
2554 | 2516 | | |
| |||
2751 | 2713 | | |
2752 | 2714 | | |
2753 | 2715 | | |
2754 | | - | |
| 2716 | + | |
2755 | 2717 | | |
2756 | 2718 | | |
2757 | | - | |
| 2719 | + | |
2758 | 2720 | | |
2759 | 2721 | | |
2760 | 2722 | | |
2761 | 2723 | | |
2762 | 2724 | | |
2763 | 2725 | | |
2764 | | - | |
| 2726 | + | |
2765 | 2727 | | |
2766 | 2728 | | |
2767 | 2729 | | |
| |||
5083 | 5045 | | |
5084 | 5046 | | |
5085 | 5047 | | |
| 5048 | + | |
5086 | 5049 | | |
5087 | 5050 | | |
5088 | 5051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | 1152 | | |
1157 | 1153 | | |
1158 | 1154 | | |
| |||
0 commit comments