sched/fair: add __init to sched_init_granularity functions
PATCH 1/1 sched/fair: add __init to sched_init_granularity functions
Function sched_init_granularity() is only called from __init functions, so mark it __init as well.
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -191,7 +191,7 @@ static void update_sysctl(void)#undef SET_SYSCTL } -void sched_init_granularity (void ) +void __init sched_init_granularity (void ) {update_sysctl (); }
Signature · 1 line
2.11.0
Quoted 23 lines · Muchun Song
Function
sched_init_granularity()is only called from__initfunctions, so mark it__initas well.Signed-off-by Muchun Song <[email protected]>--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sched/fair.c +1
-2@@ -191,7 +191,7 @@ static void update_sysctl(void)#undef SET_SYSCTL } -void sched_init_granularity (void ) +void __init sched_init_granularity (void ) {update_sysctl (); } --
Quoted 2 lines
2.11.0
Ping guys. Any suggestions?
Signature · 2 lines
Yours, Muchun
Quoted 10 lines · On Mon, 13 Apr 2020 23:07:03 +0800 宋牧春 <[email protected]> wrote:
Quoted 8 lines
kernel/sched/fair.c +1
-2-void sched_init_granularity (void ) +void __init sched_init_granularity (void ) {update_sysctl (); } --2.11.0
Ping guys. Any suggestions?
Seems fine, but not that big of an issue as it's a very small function.
ffffffff81136880 <sched_init_granularity>:ffffffff81136880: e8 7b b3 ac 00 callq ffffffff81c01c00 <__fentry__>
ffffffff81136881: R_X86_64_PLT32 __fentry__-0x4 ffffffff81136885: e9 86 86 ff ff jmpq ffffffff8112ef10 <update_sysctl> ffffffff8113688a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
But anyway, it can save 16 bytes of memory in the running kernel.
-- Steve
[tip: sched/core] sched/fair: Mark sched_init_granularity __init
In reply to Muchun SongThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: f38f12d1e0811c0ee59260b2bdadedf99e16c4af Gitweb: https://git.kernel.org/tip/f38f12d1e0811c0ee59260b2bdadedf99e16c4af Author: Muchun Song <[email protected]> AuthorDate: Mon, 06 Apr 2020 15:47:50 +08:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Thu, 30 Apr 2020 20:14:41 +02:00
sched/fair: Mark sched_init_granularity __init
Function sched_init_granularity() is only called from __init functions, so mark it __init as well.
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -191,7 +191,7 @@ static void update_sysctl(void)#undef SET_SYSCTL } -void sched_init_granularity (void ) +void __init sched_init_granularity (void ) {update_sysctl (); }