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

Pavel Machek
1999-08-17T09:13:50Z

Hi!

> 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.

Your patches start to contain more ifdefs than code. That's bad.

> diff -urN 2.3.13-bigmem-L/fs/proc/mem.c tmp/fs/proc/mem.c
> --- 2.3.13-bigmem-L/fs/proc/mem.c Tue Jul 13 02:02:09 1999
> +++ tmp/fs/proc/mem.c Tue Aug 17 00:02:48 1999
> @@ -15,6 +15,9 @@
> #include <asm/uaccess.h>
> #include <asm/io.h>
> #include <asm/pgtable.h>
> +#ifdef CONFIG_BIGMEM
> +#include <asm/bigmem.h>
> +#endif

These ifdefs are probably not needed. Few unused symbols can not hurt,
can they? And if you are worried, put #ifdef pair into asm/bigmem.h,
not into every file.

> @@ -120,7 +123,13 @@
> i = PAGE_SIZE-(addr & ~PAGE_MASK);
> if (i > scount)
> i = scount;
> +#ifdef CONFIG_BIGMEM
> + page = (char *) kmap((unsigned long) page, KM_READ);
> +#endif

What about kmap existing uncoditionaly, but (inside bigmem.h)

#ifdef CONFIG_BIGMEM
#define kmap(a,b) real_kmap(a,b)
#else
#define kmap(a,b) a
#endif

? Doing this and same for kunmap would save lots of painfull #ifdefs
otherwhere.

Pavel
--
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel. Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!