Messages in this thread | | | Subject | bloat and debugging code | Date | Fri, 23 Jul 1999 17:04:35 -0700 | From | Zack Weinberg <> |
| |
I compiled 2.2.11pre2 and 2.3.11 with the same set of options to see how much bigger the 2.3 kernel was. The results are somewhat surprising.
This is "size -A vmlinux" with .note and .comment subtracted.
section 2.2.11p2 2.3.11 2.3.11d .text 549 006 582 054 557 910 .text.lock 1 510 1 430 1 430 .rodata 65 696 110 144 66 752 .kstrtab 16 220 16 700 16 700 __ex_table 2 856 2 960 2 960 __ksymtab 4 912 5 024 5 024 .data 72 756 67 188 66 964 .data.init_task 8 192 8 192 8 192 .text.init 29 307 31 049 30 425 .data.init 1 712 2 192 2 192 .data.cacheline_aligned 7 200 288 288 .data.page_aligned 2 048 2 048 2 048 .bss 130 116 110 724 106 436 Total 891 531 939 993 867 321
Stock 2.3.11 has 32k more code and 40k more strings. That's ridiculous. It turns out to be the fault of the wait-queue and page-cache debugging macros. ld doesn't uniquify strings, so each occurence of CHECK_MAGIC() or BUG() is another duplicate.
copies string 203 wq bug, forcing oops. 203 bad magic %lx (should be %lx, creator %lx), 203 bad magic %lx (should be %lx), 199 kernel BUG at %s:%d! 199 /work/src/sys/linux-2.3.11/include/linux/sched.h
Add 32-byte alignment padding for every string, the increased size of struct wait_queue, and the code for the macros themselves, and you can see where the bloat is coming from.
"2.3.11d" is 2.3.11 with WAITQUEUE_DEBUG undefined in wait.h and BUG() changed to not printk anything in asm/page.h. With that done, we drop down to a sensible ~8k of additional code and ~1k of additional strings, most of which seems to be the new IDE driver. This kernel is actually smaller than 2.2, thanks to the elimination of the static TSS array.
N.B. I haven't actually booted the modified 2.3.11.
zw
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |