Re: [PATCH] Avoiding mmap fragmentation (against 2.6.12-rc4) to

Wolfgang Wander
2005-05-12T01:33:40Z

Andrew Morton writes:
> Wolfgang Wander <wwc@rentec.com> wrote:
> >
> > diff -rpu linux-2.6.12-rc4-vanilla/fs/binfmt_elf.c linux-2.6.12-rc4-wwc/fs/binfmt_elf.c
> > --- linux-2.6.12-rc4-vanilla/fs/binfmt_elf.c 2005-05-10 18:28:59.958415676 -0400
> > +++ linux-2.6.12-rc4-wwc/fs/binfmt_elf.c 2005-05-10 16:34:23.696894470 -0400
> > @@ -775,6 +775,7 @@ static int load_elf_binary(struct linux_
> > change some of these later */
> > set_mm_counter(current->mm, rss, 0);
> > current->mm->free_area_cache = current->mm->mmap_base;
> > + current->mm->cached_hole_size = current->mm->cached_hole_size;
>
> eh?

Outch! Good catch. Thanks Andrew!

Ken, when you post your revised version can you replace this line
with

+ current->mm->cached_hole_size = ~0UL;

Same problem in binfmt_aout.c!

Since we set free_area_cache to mmap_base the bug is hardly able to
cause any real harm but it looks more than silly.

Wolfgang