The NO_BOOTMEM patches
"Bootmem" is a simple, low-level memory allocator used by the kernel during the early parts of the bootstrap process. One might think that the kernel does not need yet another allocator, but the memory management code used during operation requires that much of the kernel already be functional before it can be called. Getting to that point involves a chain of increasingly complicated memory allocation mechanisms; on the x86 architecture, those begin the "early_res" mechanism which takes over from the BIOS "e820" facility. Once things get a little farther, the architecture-independent bootmem allocator takes over, followed, eventually, by the full buddy allocator.
Yinghai Lu came to the conclusion that things could be simplified considerably if the bootmem stage were taken out of the picture. The result was a series of patches which extends the use of the early_res mechanism for long enough to bootstrap the buddy allocator. These changes were merged for 2.6.34, but the old bootmem-based code was left behind. The CONFIG_NO_BOOTMEM option controls which allocator is used, with the default being to short out bootmem.
This is a significant change to the crucial and tricky early bootstrap code, so few people were surprised when some regressions were reported against 2.6.34-rc1. When the reports continued to arrive after -rc3, though, the level of irritation began to grow, to the point that Linus started talking about reverting the whole thing. Nobody seemed to dislike the objectives of the patches, but system-killer regressions after -rc3, along with the twisted mess of #ifdefs created by the patch and the fact that it was on by default led to some grumpiness.
Normally, new features are expected to be configured out by default; to the greatest extent possible, a new kernel should behave as much like its predecessors as possible when the default options are taken. In this case, the default led to significant changes and problems. The purpose of this option was twofold: to allow the new code to be configured out when it proved to be problematic, and to ensure that it was well tested in the mean time. Certainly it was successful on both fronts, even if some of the testers proved to be not entirely willing.
As of this writing, it would appear that the worst problems have been
fixed; talk of removing the no-bootmem code has subsided. Eventually,
perhaps, all architectures will make similar changes and the bootmem code
can be removed entirely. Meanwhile, Yinghai has a new set of changes on the horizon for 2.6.35:
replacing the early_res code with the "logical memory block" allocator
currently used by some other architectures. That change looks even more
disruptive than the bootmem elimination was.
Index entries for this article | |
---|---|
Kernel | Memory management/During early boot |
Posted Apr 8, 2010 19:28 UTC (Thu)
by felixfix (subscriber, #242)
[Link] (2 responses)
Posted Apr 10, 2010 9:25 UTC (Sat)
by Velmont (guest, #46433)
[Link] (1 responses)
Has this real impact, or "only" less code in the future? (Of course, that is not only, but as a kernel *user*, I'd like to know what's innit for me ;-) )
Posted Apr 15, 2010 17:41 UTC (Thu)
by quartz (guest, #37351)
[Link]
Less code with the same functionality and performance usually means happy developers, smaller code size in memory, and, on the long term, less bugs (yes, there are always exceptions).
Is this very useful?
Is this very useful?
Is this very useful?