RE: My own 3.5G patch - there was a bug in the patch I started with

From: Chuck Luciano (chuck@mrluciano.com)
Date: Thu Jul 10 2003 - 18:24:39 EST


I almost forgot. The patch I started with had a bug in it. (This is in case
anybody is using that patch)

+#define USER_PTRS_PER_PMD(x) ((PARTIAL_PGD && ((x)==USER_PTRS_PER_PGD-1)) ? \
+ (PTRS_PER_PMD-PARTIAL_PMD) : \
+ PTRS_PER_PMD)

I had to change this to:

#define USER_PTRS_PER_PMD(x) ((PARTIAL_PGD && ((x)==USER_PTRS_PER_PGD-1)) ? \
                PARTIAL_PMD : \
                PTRS_PER_PMD)

before my change, it worked at 1Gig boundarys (ok, i really only tested at 0xc0000000) and
at 1gig + .5Gig boundarys (e.g. 0xe0000000), 0xd0000000 would blow up, and I think 0xe8000000
was leaking some memory somewhere.

Anyway, the math was backwards.

> -----Original Message-----
> From: Dave Hansen [mailto:haveblue@us.ibm.com]
> Sent: Thursday, July 10, 2003 5:02 PM
> To: Chuck Luciano
> Cc: Linux-Kernel
> Subject: Re: My own 3.5G patch plus question on Ingo's 4G/$G patch
>
>
> On Thu, 2003-07-10 at 12:09, Chuck Luciano wrote:
> > I've been working on a patch for 2.4.18 that allows PAGE_OFFSET
> > to be set on boundarys other then 1GB multiples. I started with
> > a patch that I got from Martin Bligh and back ported it to 2.4.18.
>
> I stole the configurable PAGE_OFFSET code from Andrea, made it work with
> partial kernel pmds, and stuck it in Martin's tree. There are several
> parts to it, and I'm not sure which ones you got.
>
> > http://www.mrluciano.com/chuck/linux-2.4.18-unaligned.patch
> >
> > I'll apologize in advance for not having figured out how the configure
> > system works, so, when you apply this patch it's on. Also, you have to
> > edit vmlinux.lds AND page.h to move the boundary.
>
> Here's the 2.5 patch to do the configuration:
> http://ftp.kernel.org/pub/linux/kernel/people/mbligh/patches/2.5.73/2.5.73-mjb1/102-config_page_offset
> You'll have to adapt the arch/i386/Kconfig stuff to 2.4, but there's a
> good example of it here:
> http://ftp.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.21rc8aa1/00_3.5G-address-space-5
> (which is where I stole the code from to begin with)

Thank you. The first time through, I was mainly concerned with getting it all to work. This time I'll
make it configurable.

>
> Instead of changing _all_ of the loops which touch PMDs, I suggest you
> clean it up inside of the pmd function themselves. All of these are
> confusing:
> + if (start + PGDIR_SIZE < start)
> + break;
>

Duely noted.

>
> --
> Dave Hansen
> haveblue@us.ibm.com
>

Thank you,
Chuck L.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:37 EST