From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sasha Levin <sasha.levin@oracle.com>,
linux-mm@kvack.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Michal Hocko <mhocko@suse.com>
Subject: [PATCH 1/2] mm, oom: skip mlocked VMAs in __oom_reap_vmas()
Date: Tue, 29 Dec 2015 23:46:29 +0300 [thread overview]
Message-ID: <1451421990-32297-2-git-send-email-kirill.shutemov@linux.intel.com> (raw)
In-Reply-To: <1451421990-32297-1-git-send-email-kirill.shutemov@linux.intel.com>
As far as I can see we explicitly munlock pages everywhere before unmap
them. The only case when we don't to that is OOM-reaper.
I don't think we should bother with munlocking in this case, we can just
skip the locked VMA.
I think this patch would fix this crash:
http://lkml.kernel.org/r/5661FBB6.6050307@oracle.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
---
mm/oom_kill.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 4b0a5d8b92e1..fe58d76c1215 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -447,6 +447,13 @@ static bool __oom_reap_vmas(struct mm_struct *mm)
continue;
/*
+ * mlocked VMAs require explicit munlocking before unmap.
+ * Let's keep it simple here and skip such VMAs.
+ */
+ if (vma->vm_flags & VM_LOCKED)
+ continue;
+
+ /*
* Only anonymous pages have a good chance to be dropped
* without additional steps which we cannot afford as we
* are OOM already.
--
2.6.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-12-29 20:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-29 20:46 [PATCH 0/2] THP mlock fix Kirill A. Shutemov
2015-12-29 20:46 ` Kirill A. Shutemov [this message]
2016-01-05 12:47 ` [PATCH 1/2] mm, oom: skip mlocked VMAs in __oom_reap_vmas() Michal Hocko
2016-01-05 13:10 ` Kirill A. Shutemov
2016-01-05 13:31 ` Michal Hocko
2016-01-05 15:03 ` Kirill A. Shutemov
2016-01-05 15:45 ` Michal Hocko
2016-01-05 13:33 ` Michal Hocko
2016-01-05 15:03 ` Kirill A. Shutemov
2016-01-05 15:44 ` Sasha Levin
2015-12-29 20:46 ` [PATCH 2/2] mm, thp: clear PG_mlocked when last mapping gone Kirill A. Shutemov
2016-01-05 9:37 ` Vlastimil Babka
2016-01-05 14:37 ` Kirill A. Shutemov
2015-12-29 20:52 ` [PATCH 0/2] THP mlock fix Sasha Levin
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=1451421990-32297-2-git-send-email-kirill.shutemov@linux.intel.com \
--to=kirill.shutemov@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=sasha.levin@oracle.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