From: Andi Kleen <andi@firstfloor.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Andi Kleen <ak@linux.intel.com>, Andi Kleen <andi@firstfloor.org>,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Hillf Danton <dhillf@gmail.com>
Subject: Re: [PATCH] MM: Support more pagesizes for MAP_HUGETLB/SHM_HUGETLB v6
Date: Mon, 22 Oct 2012 18:11:51 +0200 [thread overview]
Message-ID: <20121022161151.GS16230@one.firstfloor.org> (raw)
In-Reply-To: <CAKgNAki=AL+KdYDdYnE8ZhjK-tUf5cZ163BWPe6GRM0rpi-z7w@mail.gmail.com>
On Mon, Oct 22, 2012 at 05:53:45PM +0200, Michael Kerrisk (man-pages) wrote:
> I'm not sure whether anything is using the high 8 bits of prot, bun
> passing I note that there seems to be no check that the unused bits
> are zeroed so there's a small chance existing apps are passing random
> garbage there. (Of course, mmap() is hardly the only API to have that
> fault, and it hasn't stopped us from reusing bits in those APIs,
> though sometimes we've gotten bitten by apps that did pass in random
> garbage).
Ok.
>
> >> But there seems an obvious solution here: given your value in those
> >> bits (call it 'n'), the why not apply a multiplier. I mean, certainly
> >> you never want a value <= 12 for n, and I suspect that the reasonable
> >> minimum could be much larger (e.g., 2^16). Call that minimum M. Then
> >> you could interpret the value in your bits as meaning a page size of
> >>
> >> (2^n) * M
> >
> > I considered that, but it would seem ugly and does not add that
> > many bits.
> >
> >>
> >> > So this will use up all remaining flag bits now.
> >>
> >> On the other hand, that seems really bad. It looks like that kills the
> >> ability to further extend the mmap() API with new flags in the future.
> >> It doesn't sound like we should be doing that.
> >
> > You can always add flags to PROT or add a mmap3(). Has been done before.
> > Or just don't do any new MAP_SECURITY_HOLEs
>
> There seems to be a reasonable argument here for an mmap3() with a
> 64-bit flags argument...
It's just a pain to deploy.
I think I would rather do the offset then. That could still handle
PowerPC
14 + 31 = 44 = 16GB (minimum size 16K)
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
--
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:[~2012-10-22 16:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 16:48 [PATCH] MM: Support more pagesizes for MAP_HUGETLB/SHM_HUGETLB v6 Andi Kleen
2012-10-20 3:39 ` Hillf Danton
2012-10-22 11:27 ` Michael Kerrisk
2012-10-22 13:27 ` Andi Kleen
2012-10-22 13:35 ` Andi Kleen
2012-10-22 13:56 ` Michael Kerrisk (man-pages)
2012-10-22 15:36 ` Andi Kleen
2012-10-22 15:53 ` Michael Kerrisk (man-pages)
2012-10-22 16:11 ` Andi Kleen [this message]
2012-10-22 16:23 ` Michael Kerrisk (man-pages)
2012-10-22 16:29 ` Andi Kleen
2012-10-22 16:42 ` Michael Kerrisk (man-pages)
2012-10-23 1:45 ` Benjamin Herrenschmidt
2012-10-23 1:44 ` Benjamin Herrenschmidt
2012-10-23 2:28 ` Andi Kleen
2012-10-23 7:37 ` Michael Kerrisk (man-pages)
2012-10-23 13:39 ` Andi Kleen
2012-10-23 22:56 ` Valdis.Kletnieks
2012-10-22 21:39 ` Andrew Morton
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=20121022161151.GS16230@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dhillf@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mtk.manpages@gmail.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;
as well as URLs for NNTP newsgroup(s).