[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111115153851.GB7551@tiehlicka.suse.cz>
Date: Tue, 15 Nov 2011 16:38:51 +0100
From: Michal Hocko <mhocko@...e.cz>
To: Hillf Danton <dhillf@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
Johannes Weiner <jweiner@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH] hugetlb: release pages in the error path of hugetlb_cow()
On Fri 11-11-11 21:01:20, Hillf Danton wrote:
> If fail to prepare anon_vma, {new, old}_page should be released, or they will
> escape the track and/or control of memory management.
Looks good (intrduced by in .36 by 0fe6e20b: hugetlb, rmap: add reverse
mapping for hugepage). The failure case is really not probable but I
guess this is still a candidate for stable kernel.
>
> Thanks
>
> Signed-off-by: Hillf Danton <dhillf@...il.com>
Reviewed-by: Michal Hocko <mhocko@...e.cz>
> ---
>
> --- a/mm/hugetlb.c Fri Nov 11 20:36:32 2011
> +++ b/mm/hugetlb.c Fri Nov 11 20:43:06 2011
> @@ -2422,6 +2422,8 @@ retry_avoidcopy:
> * anon_vma prepared.
> */
> if (unlikely(anon_vma_prepare(vma))) {
> + page_cache_release(new_page);
> + page_cache_release(old_page);
> /* Caller expects lock to be held */
> spin_lock(&mm->page_table_lock);
> return VM_FAULT_OOM;
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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