Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600997 > unrolled thread
| Started by | Andi Kleen <andi@firstfloor.org> |
|---|---|
| First post | 2017-03-15 03:20 +0100 |
| Last post | 2017-03-15 03:20 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
Some inline debloating, 4.11 edition Andi Kleen <andi@firstfloor.org> - 2017-03-15 03:20 +0100
[PATCH 3/7] sched: Out of line __update_load_avg Andi Kleen <andi@firstfloor.org> - 2017-03-15 03:20 +0100
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2017-03-15 03:20 +0100 |
| Subject | Some inline debloating, 4.11 edition |
| Message-ID | <tl6HD-OK-3@gated-at.bofh.it> |
I was looking for bloated inlines, and fixed some of the worst ones in current master. Often inlines grow over time, and at some point it doesn't make sense anymore to have them inline. But the inline attribute is often kept. The attached patches together save around 70k in my kernel. Andrew, some of the patches are for areas which have no clear maintainer.
[toc] | [next] | [standalone]
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2017-03-15 03:20 +0100 |
| Subject | [PATCH 3/7] sched: Out of line __update_load_avg |
| Message-ID | <tl6HE-OK-25@gated-at.bofh.it> |
| In reply to | #1600997 |
From: Andi Kleen <ak@linux.intel.com>
This is a very complex function, which is called in multiple places.
It is unlikely that inlining or not inlining it makes any difference
for its run time.
This saves around 13k text in my kernel
text data bss dec hex filename
9083992 5367600 11116544 25568136 1862388 vmlinux-before-load-avg
9070166 5367600 11116544 25554310 185ed86 vmlinux-load-avg
Cc: peterz@infradead.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index dea138964b91..78ace89cd481 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2848,7 +2848,7 @@ static u32 __compute_runnable_contrib(u64 n)
* load_avg = u_0` + y*(u_0 + u_1*y + u_2*y^2 + ... )
* = u_0 + u_1*y + u_2*y^2 + ... [re-labeling u_i --> u_{i+1}]
*/
-static __always_inline int
+static int
__update_load_avg(u64 now, int cpu, struct sched_avg *sa,
unsigned long weight, int running, struct cfs_rq *cfs_rq)
{
--
2.9.3
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web