Skip to contentSkip to conversation

sched/fair: add __init to sched_init_granularity functions

PATCH Applied Muchun Song 3 participants 4 messages Apr 6, 2020 – May 1, 2020 Scheduler

lore
Share & tools
lore
#0 lore raw

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
index 1141c7e77564d..6f05843c76d7d 100644
@@ -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
author
#1 lore raw
Quoted 23 lines · Muchun Song

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 -2
index 1141c7e77564d..6f05843c76d7d 100644
@@ -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
reviewer Reviewed-by
#2 lore raw
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

merge bot Applied
#3 lore raw

[tip: sched/core] sched/fair: Mark sched_init_granularity __init

In reply to Muchun Song
The 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
index fac5b2f..cd7fd7e 100644
@@ -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();
 }