From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: "Roman Jarosz" <kedgedev@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
lkml <linux-kernel@vger.kernel.org>,
"A. Boulan" <arnaud.boulan@libertysurf.fr>,
michael@reinelt.co.at, jcnengel@googlemail.com,
rientjes@google.com, earny@net4u.de,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Eric Anholt <eric@anholt.net>
Subject: Re: OOM-Killer kills too much with 2.6.32.2
Date: Tue, 26 Jan 2010 14:19:23 +0900 (JST) [thread overview]
Message-ID: <20100126141055.5AAD.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <op.u63v1pxzasvm2a@kedge>
(cc to lots related person)
> On Mon, 25 Jan 2010 02:48:08 +0100, KOSAKI Motohiro
> <kosaki.motohiro@jp.fujitsu.com> wrote:
>
> >> Hi,
> >>
> >> since kernel 2.6.32.2 (also tried 2.6.32.3) I get a lot of oom-killer
> >> kills when I do hard disk intensive tasks (mainly in VirtualBox which is
> >> running Windows XP) and IMHO it kills processes even if I have a lot of
> >> free memory.
> >>
> >> Is this a known bug? I have self compiled kernel so I can try patches.
> >
> > Can you please post your .config?
Hi all,
Strangely, all reproduce machine are x86_64 with Intel i915. but I don't
have any solid evidence.
Can anyone please apply following debug patch and reproduce this issue?
this patch write some debug message into /var/log/messages.
Thanks.
---
mm/memory.c | 45 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 09e4b1b..5c9ebd8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2128,17 +2128,23 @@ reuse:
gotten:
pte_unmap_unlock(page_table, ptl);
- if (unlikely(anon_vma_prepare(vma)))
+ if (unlikely(anon_vma_prepare(vma))) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom;
+ }
if (is_zero_pfn(pte_pfn(orig_pte))) {
new_page = alloc_zeroed_user_highpage_movable(vma, address);
- if (!new_page)
+ if (!new_page) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom;
+ }
} else {
new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address);
- if (!new_page)
+ if (!new_page) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom;
+ }
cow_user_page(new_page, old_page, address, vma);
}
__SetPageUptodate(new_page);
@@ -2153,8 +2159,10 @@ gotten:
unlock_page(old_page);
}
- if (mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))
+ if (mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL)) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom_free_new;
+ }
/*
* Re-check the pte - we dropped the lock
@@ -2272,6 +2280,10 @@ oom:
unwritable_page:
page_cache_release(old_page);
+
+ if (ret & VM_FAULT_OOM)
+ printk(KERN_ERR "do_wp ->page_mkwrite OOM %pf %x\n", vma->vm_ops->page_mkwrite, ret);
+
return ret;
}
@@ -2670,15 +2682,21 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* Allocate our own private page. */
pte_unmap(page_table);
- if (unlikely(anon_vma_prepare(vma)))
+ if (unlikely(anon_vma_prepare(vma))) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom;
+ }
page = alloc_zeroed_user_highpage_movable(vma, address);
- if (!page)
+ if (!page) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom;
+ }
__SetPageUptodate(page);
- if (mem_cgroup_newpage_charge(page, mm, GFP_KERNEL))
+ if (mem_cgroup_newpage_charge(page, mm, GFP_KERNEL)) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
goto oom_free_page;
+ }
entry = mk_pte(page, vma->vm_page_prot);
if (vma->vm_flags & VM_WRITE)
@@ -2742,8 +2760,12 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
vmf.page = NULL;
ret = vma->vm_ops->fault(vma, &vmf);
- if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
+ if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) {
+ if (ret & VM_FAULT_OOM)
+ printk(KERN_ERR "->fault OOM %pf %x %x\n", vma->vm_ops->fault, ret, flags);
+
return ret;
+ }
if (unlikely(PageHWPoison(vmf.page))) {
if (ret & VM_FAULT_LOCKED)
@@ -2768,16 +2790,19 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (!(vma->vm_flags & VM_SHARED)) {
anon = 1;
if (unlikely(anon_vma_prepare(vma))) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
ret = VM_FAULT_OOM;
goto out;
}
page = alloc_page_vma(GFP_HIGHUSER_MOVABLE,
vma, address);
if (!page) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
ret = VM_FAULT_OOM;
goto out;
}
if (mem_cgroup_newpage_charge(page, mm, GFP_KERNEL)) {
+ printk(KERN_ERR "OOM at %s:%d\n", __FILE__, __LINE__);
ret = VM_FAULT_OOM;
page_cache_release(page);
goto out;
@@ -2896,6 +2921,10 @@ out:
unwritable_page:
page_cache_release(page);
+
+ if (ret & VM_FAULT_OOM)
+ printk(KERN_ERR "->page_mkwrite OOM %pf %x %x\n", vma->vm_ops->page_mkwrite, ret, flags);
+
return ret;
}
--
1.6.5.2
next prev parent reply other threads:[~2010-01-26 5:19 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 13:15 Roman Jarosz
2010-01-23 0:40 ` David Rientjes
2010-01-25 22:12 ` Roman Jarosz
2010-01-25 1:48 ` KOSAKI Motohiro
2010-01-25 20:47 ` Roman Jarosz
2010-01-26 5:19 ` KOSAKI Motohiro [this message]
2010-01-26 7:51 ` A Rojas
2010-01-26 9:06 ` Roman Jarosz
2010-01-26 11:07 ` KOSAKI Motohiro
2010-01-26 12:33 ` Chris Wilson
2010-01-26 13:03 ` KOSAKI Motohiro
2010-01-26 13:18 ` Chris Wilson
2010-01-26 13:59 ` Michael Reinelt
2010-01-26 14:07 ` Michael Reinelt
2010-01-27 0:50 ` KOSAKI Motohiro
2010-01-27 9:56 ` Pekka Enberg
2010-01-27 10:55 ` Linus Torvalds
2010-01-27 11:12 ` Pekka Enberg
2010-01-27 11:14 ` [PATCH] drm/i915: Selectively enable self-reclaim Chris Wilson
2010-01-27 11:20 ` Pekka Enberg
2010-01-27 11:30 ` Michael Reinelt
2010-01-28 3:15 ` Michael Reinelt
2010-01-28 18:21 ` Roman Jarosz
2010-01-27 11:50 ` KOSAKI Motohiro
2010-01-27 12:16 ` Linus Torvalds
2010-01-27 12:28 ` Linus Torvalds
2010-01-27 15:25 ` Chris Wilson
2010-01-27 16:09 ` Linus Torvalds
2010-01-27 17:14 ` Chris Wilson
2010-01-27 17:19 ` Linus Torvalds
2010-01-27 21:03 ` Roman Jarosz
2010-06-30 6:54 ` [Intel-gfx] " Dave Airlie
2010-06-30 7:05 ` Chris Wilson
2010-06-30 23:07 ` Linus Torvalds
2010-07-01 1:24 ` Linus Torvalds
2010-07-01 1:55 ` KOSAKI Motohiro
2010-07-01 10:15 ` Dave Airlie
2010-07-01 11:19 ` Chris Wilson
2010-07-01 22:34 ` M. Vefa Bicakci
2010-07-01 23:59 ` Linus Torvalds
2010-07-02 0:06 ` Dave Airlie
2010-07-02 0:49 ` Dave Airlie
2010-07-02 1:28 ` Linus Torvalds
2010-07-17 18:58 ` M. Vefa Bicakci
2010-07-17 19:15 ` Linus Torvalds
2010-07-18 14:27 ` M. Vefa Bicakci
2010-07-18 16:59 ` Linus Torvalds
2010-01-28 6:37 ` Willy Tarreau
2010-01-26 13:41 ` OOM-Killer kills too much with 2.6.32.2 Roman Jarosz
2010-01-27 0:14 ` KOSAKI Motohiro
2010-01-27 9:53 ` Roman Jarosz
2010-01-26 13:57 ` Pekka Enberg
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=20100126141055.5AAD.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=arnaud.boulan@libertysurf.fr \
--cc=earny@net4u.de \
--cc=eric@anholt.net \
--cc=jbarnes@virtuousgeek.org \
--cc=jcnengel@googlemail.com \
--cc=kedgedev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@reinelt.co.at \
--cc=rientjes@google.com \
/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
all inboxes | Powered by JetHome®