From: Andy Lutomirski <luto@amacapital.net>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: MAP_HUGETLB and MPOL_PREFERRED = SIGBUS
Date: Thu, 18 Jul 2013 17:51:06 -0700 [thread overview]
Message-ID: <CALCETrVXzXLqvB+S6BMXuFbVGftg5Kwk+fGe1=w1G9S67S_ivA@mail.gmail.com> (raw)
When I mmap anonymous hugepages with MAP_HUGETLB and there are
available (pre-reserved) hugepages available, but only on the wrong
node, things blow up. The mmap succeeds, as it should (the accounting
here is wrong -- known issue AFAIK, but that's only relevant to
MPOL_BIND or cpusets). But writing to the resulting page causes a
SIGBUS.
AFAICS the issue is that dequeue_huge_page_vma is calling
huge_zonelist, which returns a single-entry nodemask. The loop over
allowable zones* will never try other numa zones, and the function
fails.
I'm not sure whether it would be better to try other nodes first or to
try get get a page from the buddy allocator on the preferred node
first, but currently the other nodes' reserved lists are never
checked. The result is a crash.
Working around this in userspace is going to be a real PITA. Grr.
* Why is this iterating zones instead of nodes?
--Andy
--
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>
reply other threads:[~2013-07-19 0:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CALCETrVXzXLqvB+S6BMXuFbVGftg5Kwk+fGe1=w1G9S67S_ivA@mail.gmail.com' \
--to=luto@amacapital.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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