summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJianChunfu <jansef.jian@hj-micro.com>2026-07-07 17:23:54 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-08-03 21:10:11 -0700
commit1db1573bc59f7c91fa2867e4cbea73494d5b623e (patch)
tree6ca39fd45ebaec1030237076f8b86ebe31df4445 /scripts
parentdc334b36ede14a40a59c54359500d9bf459e5308 (diff)
kernel/fork: declare max_threads __read_mostly
max_threads is initialized once by fork_init()->set_max_threads(), and thereafter is mostly read in hot path, such as copy_process(). The fact that it is mostly read and not written to makes it candidates for __read_mostly declarations. I have already tested on my machine(arm64,256core,kernel-7.1.3) with 'hackbench -P -l 500 -g 100/500/1000/2000' and the results show that there is an average of 13% improvement in performance. before patch: hackbench -g 100 500 1000 2000 1.094 4.651 13.305 36.322 after patch: hackbench -g 100 500 1000 2000 0.823 4.487 11.107 32.987 Above data are the average values obtained from multiple tests, and there was indeed some fluctuation in the data during the tests. Link: https://lore.kernel.org/20260707092354.465847-1-jansef.jian@hj-micro.com Signed-off-by: JianChunfu <jansef.jian@hj-micro.com> Reviewed-by: Lorenzo Stoakes <ljs@kernel.org> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Kees Cook <kees@kernel.org> Cc: Liam R. Howlett <liam@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions