lkml.org 
[lkml]   [2009]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [121/136] mm: fix anonymous dirtying
On Thu, 1 Oct 2009, Greg KH wrote:
> 2.6.31-stable review patch. If anyone has any objections, please let us know.
>
> ------------------
> From: Hugh Dickins <hugh.dickins@tiscali.co.uk>
>
> commit 1ac0cb5d0e22d5e483f56b2bc12172dec1cf7536 upstream.
>
> do_anonymous_page() has been wrong to dirty the pte regardless.
> If it's not going to mark the pte writable, then it won't help
> to mark it dirty here, and clogs up memory with pages which will
> need swap instead of being thrown away. Especially wrong if no
> overcommit is chosen, and this vma is not yet VM_ACCOUNTed -
> we could exceed the limit and OOM despite no overcommit.

Thanks a lot for including this little fix in 2.6.31.2.
It is equally relevant to both 2.6.27.36 and 2.6.30.9,
so if not too late, please consider adding it into those too.

Thanks,
Hugh

>
> Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Acked-by: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Nick Piggin <npiggin@suse.de>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
> mm/memory.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2638,7 +2638,8 @@ static int do_anonymous_page(struct mm_s
> goto oom_free_page;
>
> entry = mk_pte(page, vma->vm_page_prot);
> - entry = maybe_mkwrite(pte_mkdirty(entry), vma);
> + if (vma->vm_flags & VM_WRITE)
> + entry = pte_mkwrite(pte_mkdirty(entry));
>
> page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
> if (!pte_none(*page_table))


\
 
 \ /
  Last update: 2009-10-02 18:37    [W:0.636 / U:4.264 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site