Re: [bigmem-patch] 4GB with Linux on IA32

Linus Torvalds
1999-08-17T06:29:48Z

On Tue, 17 Aug 1999, Andrea Arcangeli wrote:
>
> This incremental (against bigmem-2.3.13-L) patch will fix the ptrace and
> /proc/*/mem read/writes to other process VM inside the kernel.

Andrea, you really need to clean these things up.

The bigmem patches look fine _except_ for the fact that they have these

#ifdef CONFIG_BIGMEM

turds all over the place. That's NOT how to do it.

Instead, you should unconditionally always do

#include <linux/bigmem.h>

which in turn does something like this:

#ifdef CONFIG_BIGMEM

#include <asm/bigmem.h>

#else

#define kmap(page) page_address(page)
#define kunmap(page) do { } while (0)

#endif

and then there is not a _single_ #ifdef inside any actual code.

Remember: if you have to have #ifdef's in actual functional code, you're
doing something wrong. I don't see why you can't just abstract the thing
away with zero performance degradation for the non-bigmem case by just
making the mapping function the existing identity function.

I'd like you to do the above cleanup, and then the bigmem patches look
like they could easily be integrated into the current 2.3.x series. But
with #ifdef's it won't.

Linus