[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALszF6DaFo7Xnehtt7vom32ydenhEFhx-YjH4BtLxLL6QwMmvA@mail.gmail.com>
Date: Mon, 16 Feb 2015 12:45:24 +0100
From: Maxime Coquelin <mcoquelin.stm32@...il.com>
To: Joonsoo Kim <js1304@...il.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>,
Linux Memory Management List <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Regression]: mm: nommu: Memory leak introduced with commit
"mm/nommu: use alloc_pages_exact() rather than its own implementation"
Hello Joonsoo,
2015-02-16 5:43 GMT+01:00 Joonsoo Kim <js1304@...il.com>:
>
> Hello,
>
> Sorry for my mistake.
> Problem happens because when we allocate memory through
> __get_free_pages(), refcount of each pages is not 1 except
> head page. Below modification will fix your problem. Could you
> test it, please?
I just tested it, and confirm it fixes the regression.
You can add my:
Tested-by: Maxime Coquelin <mcoquelin.stm32@...il.com>
Thanks for the quick fix!
Maxime
>
> Thanks.
>
> ------------>8-------------
> diff --git a/mm/nommu.c b/mm/nommu.c
> index 28bd8c4..ff6c1e2 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -1189,11 +1189,9 @@ static int do_mmap_private(struct vm_area_struct *vma,
> if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) {
> total = point;
> kdebug("try to alloc exact %lu pages", total);
> - base = alloc_pages_exact(len, GFP_KERNEL);
> - } else {
> - base = (void *)__get_free_pages(GFP_KERNEL, order);
> }
>
> + base = alloc_pages_exact(total << PAGE_SHIFT, GFP_KERNEL);
> if (!base)
> goto enomem;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists