From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org,
stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Rik van Riel <riel@redhat.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Nick Piggin <npiggin@suse.de>, Mel Gorman <mel@csn.ul.ie>,
Minchan Kim <minchan.kim@gmail.com>
Subject: [patch 10/09] mm: fix anonymous dirtying
Date: Fri, 2 Oct 2009 10:49:12 -0700 [thread overview]
Message-ID: <20091002174912.GA21917@kroah.com> (raw)
In-Reply-To: <20091001231938.GA29593@kroah.com>
2.6.27-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.
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
@@ -2422,7 +2422,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))
next prev parent reply other threads:[~2009-10-02 17:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 23:19 [patch 0/9] 2.6.27.36-stable review Greg KH
2009-10-01 23:16 ` Greg KH
2009-10-01 23:16 ` [patch 1/9] fs: make sure data stored into inode is properly seen before unlocking new inode Greg KH
2009-10-01 23:16 ` [patch 2/9] p54usb: add Zcomax XG-705A usbid Greg KH
2009-10-01 23:16 ` [patch 3/9] enc28j60: fix RX buffer overflow Greg KH
2009-10-01 23:16 ` [patch 4/9] pcnet_cs: Fix misuse of the equality operator Greg KH
2009-10-01 23:16 ` [patch 5/9] Fix incorrect stable backport to bas_gigaset Greg KH
2009-10-01 23:16 ` [patch 6/9] net ax25: Fix signed comparison in the sockopt handler Greg KH
2009-10-01 23:16 ` [patch 7/9] net: Make the copy length in af_packet sockopt handler unsigned Greg KH
2009-10-01 23:16 ` [patch 8/9] netfilter: bridge: refcount fix Greg KH
2009-10-01 23:16 ` [patch 9/9] hugetlb: restore interleaving of bootmem huge pages (2.6.31) Greg KH
2009-10-02 17:49 ` Greg KH [this message]
2009-10-02 17:50 ` [patch 11/09] mmap: avoid unnecessary anon_vma lock acquisition in vma_adjust() Greg KH
2009-10-02 17:50 ` [patch 0/9] 2.6.27.36-stable review Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091002174912.GA21917@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=hugh.dickins@tiscali.co.uk \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=npiggin@suse.de \
--cc=riel@redhat.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox