Skip to contentSkip to conversation

arch/x86/mm/ioremap unification grew by 10x

DISCUSSION Matt Mackall 5 participants 9 messages Feb 15, 2008 – Feb 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#1 lore raw
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Sam

#2 lore raw
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Correction: those numbers should be halved. So we're going from .9k to 10.4k.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#3 lore raw
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Correction: those numbers should be halved. So we're going from .9k to 10.4k.

And here's most of the cause:

000002b8 00000124 T early_ioremap
00001000 00001000 t bm_pte
00002000 00000004 T early_ioremap_debug

static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

				__attribute__((aligned(PAGE_SIZE)));

Double ouch. First, this isn't in BSS. Second, even though it's initdata, the alignment slop won't get recovered.

Don't we have a special section for page-aligned crap so it doesn't waste most of two pages?

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#4 lore raw
Quoted 18 lines · Matt Mackall
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Correction: those numbers should be halved. So we're going from .9k to 10.4k.

And here's most of the cause:

000002b8 00000124 T early_ioremap
00001000 00001000 t bm_pte
00002000 00000004 T early_ioremap_debug

Quoted 5 lines

static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

				__attribute__((aligned(PAGE_SIZE)));

Double ouch. First, this isn't in BSS. Second, even though it's initdata, the alignment slop won't get recovered.

551889a6e2a24a9c06fd453ea03b57b7746ffdc0 (the reason you CC'd me) only changed this from unsigned long[1024] to pte_t[PAGE_SIZE/sizeof(pte_t)]

-static __initdata unsigned long bm_pte[1024] +static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

                                __attribute__((aligned(PAGE_SIZE)));

I don't think that would have changed anything in this respect. It seems to have been that way since 0947b2f31ca1ea1211d3cde2dbd8fcec579ef395 when it was added (Huang Ying CC'd).

Quoted 2 lines

Don't we have a special section for page-aligned crap so it doesn't waste most of two pages?

We have .bss.page_aligned and it seems appropriate to use it.

Ian.

---
From ac954372c1ed7830148bdea1e4283856c05c354f Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Sun, 17 Feb 2008 19:08:34 +0000
Subject: [PATCH] x86: bm_pte can be placed in .bss.page_aligned.

text data bss dec hex filename
- 3388 8236 4 11628 2d6c ../build-32/arch/x86/mm/ioremap.o
+ 3388 48 4100 7536 1d70 ../build-32/arch/x86/mm/ioremap.o

Cc Matt Mackall <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Huang Ying <[email protected]>
---
 arch/x86/mm/ioremap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/ioremap.c +2 -2
index 69f4981..c62ecbd 100644
@@ -262,8 +262,8 @@ static int __init early_ioremap_debug_setup(char *str)
 early_param("early_ioremap_debug", early_ioremap_debug_setup);
 
 static __initdata int after_paging_init;
-static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
-				__attribute__((aligned(PAGE_SIZE)));
+static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
+		__attribute__((__section__(".bss.page_aligned")));
 
 static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
 {
Signature · 7 lines
1.5.4


-- 
Ian Campbell

In which level of metalanguage are you now speaking?
#5 lore raw
Quoted 68 lines · Ian Campbell
Quoted 18 lines · Matt Mackall
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Correction: those numbers should be halved. So we're going from .9k to 10.4k.

And here's most of the cause:

000002b8 00000124 T early_ioremap
00001000 00001000 t bm_pte
00002000 00000004 T early_ioremap_debug

Quoted 5 lines

static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

				__attribute__((aligned(PAGE_SIZE)));

Double ouch. First, this isn't in BSS. Second, even though it's initdata, the alignment slop won't get recovered.

551889a6e2a24a9c06fd453ea03b57b7746ffdc0 (the reason you CC'd me) only changed this from unsigned long[1024] to pte_t[PAGE_SIZE/sizeof(pte_t)]

(quoted diff) +1 -1
-static __initdata unsigned long bm_pte[1024]
+static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
                                __attribute__((aligned(PAGE_SIZE)));

I don't think that would have changed anything in this respect. It seems to have been that way since 0947b2f31ca1ea1211d3cde2dbd8fcec579ef395 when it was added (Huang Ying CC'd).

Quoted 2 lines

Don't we have a special section for page-aligned crap so it doesn't waste most of two pages?

We have .bss.page_aligned and it seems appropriate to use it.

Ian.

---
From ac954372c1ed7830148bdea1e4283856c05c354f Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Sun, 17 Feb 2008 19:08:34 +0000
Subject: [PATCH] x86: bm_pte can be placed in .bss.page_aligned.

text data bss dec hex filename
- 3388 8236 4 11628 2d6c ../build-32/arch/x86/mm/ioremap.o
+ 3388 48 4100 7536 1d70 ../build-32/arch/x86/mm/ioremap.o

Cc Matt Mackall <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Huang Ying <[email protected]>
---
 arch/x86/mm/ioremap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/ioremap.c +0 -0
index 69f4981..c62ecbd 100644

arch/x86/mm/ioremap.c static int __init early_ioremap_debug_setup(char *str) · line 265

Quoted 6 lines
arch/x86/mm/ioremap.c +1 -2
@@ -262,8 +262,8 @@ static int __init early_ioremap_debug_setup(char *str)
 early_param("early_ioremap_debug", early_ioremap_debug_setup);
 
 static __initdata int after_paging_init;
-static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
-				__attribute__((aligned(PAGE_SIZE)));
+static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

Replace

arch/x86/mm/ioremap.c static int __init early_ioremap_debug_setup(char *str) · line 266

Quoted 1 line
arch/x86/mm/ioremap.c +1 -0
+		__attribute__((__section__(".bss.page_aligned")));

with the shorter form:

arch/x86/mm/ioremap.c static int __init early_ioremap_debug_setup(char *str) · line 267

Quoted 1 line
arch/x86/mm/ioremap.c +1 -0
+		__section(.bss.page_aligned)));

Sam

#6 lore raw
Quoted 10 lines · Sam Ravnborg

arch/x86/mm/ioremap.c static int __init early_ioremap_debug_setup(char *str) · line 265

Quoted 4 lines

static __initdata int after_paging_init;

arch/x86/mm/ioremap.c +1 -2
-static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
-				__attribute__((aligned(PAGE_SIZE)));
+static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

Replace

arch/x86/mm/ioremap.c static int __init early_ioremap_debug_setup(char *str) · line 266

Quoted 1 line
arch/x86/mm/ioremap.c +1 -0
+		__attribute__((__section__(".bss.page_aligned")));

with the shorter form:

Review

Quoted 1 line
(quoted diff) +1 -0
+		__section(.bss.page_aligned)));

i've picked up Ian's patch into x86.git and have done the above change. Thanks,

Ingo

#7 lore raw
In reply to Ian Campbell
Quoted 32 lines · Ian Campbell
Quoted 18 lines · Matt Mackall
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Matt Mackall

In 2.6.24 defconfig, my build stats show ioremap_32.o was 1.8k. In 2.6.25-rc1, the unified ioremap.o is 20.8k.

Just an observation - 17 commits touches said file after the unification (at least in latest -linus).

Correction: those numbers should be halved. So we're going from .9k to 10.4k.

And here's most of the cause:

000002b8 00000124 T early_ioremap
00001000 00001000 t bm_pte
00002000 00000004 T early_ioremap_debug

Quoted 5 lines

static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

				__attribute__((aligned(PAGE_SIZE)));

Double ouch. First, this isn't in BSS. Second, even though it's initdata, the alignment slop won't get recovered.

551889a6e2a24a9c06fd453ea03b57b7746ffdc0 (the reason you CC'd me) only changed this from unsigned long[1024] to pte_t[PAGE_SIZE/sizeof(pte_t)]

(quoted diff) +1 -1
-static __initdata unsigned long bm_pte[1024]
+static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
                                __attribute__((aligned(PAGE_SIZE)));
Quoted 8 lines

I don't think that would have changed anything in this respect. It seems to have been that way since 0947b2f31ca1ea1211d3cde2dbd8fcec579ef395 when it was added (Huang Ying CC'd).

Quoted 2 lines

Don't we have a special section for page-aligned crap so it doesn't waste most of two pages?

We have .bss.page_aligned and it seems appropriate to use it.

But .bss.page_aligned is not an init section, this will waste some memory after boot. Do you think that it is more appropriate to add another section like .init.bss and .init.bss.page_aligned.

Best Regards,
Huang Ying

#8 lore raw
Quoted 23 lines · Huang, Ying
Quoted 23 lines
Quoted 11 lines

And here's most of the cause:

000002b8 00000124 T early_ioremap
00001000 00001000 t bm_pte
00002000 00000004 T early_ioremap_debug

static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

				__attribute__((aligned(PAGE_SIZE)));

Double ouch. First, this isn't in BSS. Second, even though it's initdata, the alignment slop won't get recovered.

551889a6e2a24a9c06fd453ea03b57b7746ffdc0 (the reason you CC'd me) only changed this from unsigned long[1024] to pte_t[PAGE_SIZE/sizeof(pte_t)]

(quoted diff) +1 -1
-static __initdata unsigned long bm_pte[1024]
+static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
                                __attribute__((aligned(PAGE_SIZE)));

I don't think that would have changed anything in this respect. It seems to have been that way since 0947b2f31ca1ea1211d3cde2dbd8fcec579ef395 when it was added (Huang Ying CC'd).

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Don't we have a special section for page-aligned crap so it doesn't waste most of two pages?

We have .bss.page_aligned and it seems appropriate to use it.

But .bss.page_aligned is not an init section, this will waste some memory after boot. Do you think that it is more appropriate to add another section like .init.bss and .init.bss.page_aligned.

agreed, and i'd suggest we do so before this information gets forgotten and someone has to re-discover the fix the hard way.

Ingo