From: Vlastimil Babka <vbabka@suse.cz>
To: Mel Gorman <mgorman@techsingularity.net>,
Ganapatrao Kulkarni <gpkulkarni@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC 5/4] mm, page_alloc: fix premature OOM due to vma mempolicy update
Date: Wed, 18 Jan 2017 17:23:38 +0100 [thread overview]
Message-ID: <a3bc44cd-3c81-c20e-aecb-525eb73b9bfe@suse.cz> (raw)
In-Reply-To: <7c459f26-13a6-a817-e508-b65b903a8378@suse.cz>
On 01/18/2017 05:20 PM, Vlastimil Babka wrote:
> By changing the LTP cpuset01 testcase (will post patch as a reply) this was
> confirmed and the problem is also older than the changes in 4.7.
-----8<-----
diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c
index 558420f72f9b..ef673366e15e 100644
--- a/testcases/kernel/mem/cpuset/cpuset01.c
+++ b/testcases/kernel/mem/cpuset/cpuset01.c
@@ -40,6 +40,7 @@
#include <fcntl.h>
#include <math.h>
#if HAVE_NUMAIF_H
+#include <linux/mempolicy.h>
#include <numaif.h>
#endif
#include <signal.h>
@@ -61,6 +62,7 @@ volatile int end;
static int *nodes;
static int nnodes;
static long ncpus;
+static unsigned long nmask[MAXNODES / BITS_PER_LONG] = { 0 };
static void testcpuset(void);
static void sighandler(int signo LTP_ATTRIBUTE_UNUSED);
@@ -89,7 +91,6 @@ static void testcpuset(void)
{
int lc;
int child, i, status;
- unsigned long nmask[MAXNODES / BITS_PER_LONG] = { 0 };
char mems[BUFSIZ], buf[BUFSIZ];
read_cpuset_files(CPATH, "cpus", buf);
@@ -105,6 +106,7 @@ static void testcpuset(void)
for (i = 0; i < nnodes; i++) {
if (nodes[i] >= MAXNODES)
continue;
+ printf("bind to node %d\n", nodes[i]);
set_node(nmask, nodes[i]);
}
if (set_mempolicy(MPOL_BIND, nmask, MAXNODES) == -1)
@@ -163,6 +165,8 @@ static int mem_hog(void)
tst_resm(TFAIL | TERRNO, "mmap");
break;
}
+ if (mbind(addr, pagesize * 10, MPOL_BIND, nmask, MAXNODES, 0) == -1)
+ tst_brkm(TBROK | TERRNO, cleanup, "set_mempolicy");
memset(addr, 0xF7, pagesize * 10);
munmap(addr, pagesize * 10);
}
--
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>
prev parent reply other threads:[~2017-01-18 16:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 22:16 [RFC 0/4] fix premature OOM due to cpuset races Vlastimil Babka
2017-01-17 22:16 ` [RFC 1/4] mm, page_alloc: fix check for NULL preferred_zone Vlastimil Babka
2017-01-18 9:31 ` Michal Hocko
2017-01-18 9:45 ` Vlastimil Babka
2017-01-18 9:53 ` Michal Hocko
2017-01-18 9:45 ` Mel Gorman
2017-01-17 22:16 ` [RFC 2/4] mm, page_alloc: fix fast-path race with cpuset update or removal Vlastimil Babka
2017-01-18 9:34 ` Michal Hocko
2017-01-18 9:46 ` Mel Gorman
2017-01-17 22:16 ` [RFC 3/4] mm, page_alloc: move cpuset seqcount checking to slowpath Vlastimil Babka
2017-01-18 7:22 ` Hillf Danton
2017-01-18 9:26 ` Vlastimil Babka
2017-01-18 9:40 ` Michal Hocko
2017-01-18 9:48 ` Vlastimil Babka
2017-01-18 9:55 ` Michal Hocko
2017-01-18 10:03 ` Mel Gorman
2017-01-17 22:16 ` [RFC 4/4] mm, page_alloc: fix premature OOM when racing with cpuset mems update Vlastimil Babka
2017-01-18 7:12 ` Hillf Danton
2017-01-18 9:32 ` Vlastimil Babka
2017-01-18 10:08 ` Mel Gorman
2017-01-18 9:19 ` [RFC 0/4] fix premature OOM due to cpuset races Michal Hocko
2017-01-18 16:20 ` [RFC 5/4] mm, page_alloc: fix premature OOM due to vma mempolicy update Vlastimil Babka
2017-01-18 16:23 ` Vlastimil Babka [this message]
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=a3bc44cd-3c81-c20e-aecb-525eb73b9bfe@suse.cz \
--to=vbabka@suse.cz \
--cc=gpkulkarni@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.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;
as well as URLs for NNTP newsgroup(s).