From: Linus Torvalds <torvalds@linux-foundation.org>
To: Mel Gorman <mgorman@suse.de>, Peter Anvin <hpa@zytor.com>,
Ingo Molnar <mingo@kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Cc: Steven Noonan <steven@uplinklabs.net>,
Rik van Riel <riel@redhat.com>,
David Vrabel <david.vrabel@citrix.com>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
linux-mm <linux-mm@kvack.org>,
Cyrill Gorcunov <gorcunov@gmail.com>
Subject: Re: [PATCH 2/2] x86: use pv-ops in {pte,pmd}_{set,clear}_flags()
Date: Mon, 31 Mar 2014 09:10:07 -0700 [thread overview]
Message-ID: <CA+55aFwM5GXr3m2GyL6-PWS-VepPO7HVN-311tM3tFDtDVuGYA@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFwGF9G+FBH3a5L0hHkTYaP9eCAfUT+OwvqUY_6N6LcbaQ@mail.gmail.com>
[ Adding x86 maintainers - Ingo was involved earlier, make it more explicit ]
On Mon, Mar 31, 2014 at 8:41 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So on x86, the obvious model is to use another bit. We've got several.
> The _PAGE_NUMA case only matters for when _PAGE_PRESENT is clear, and
> when that bit is clear the hardware doesn't care about any of the
> other bits. Currently we use:
>
> #define _PAGE_BIT_PROTNONE _PAGE_BIT_GLOBAL
> #define _PAGE_BIT_FILE _PAGE_BIT_DIRTY
>
> which are bits 8 and 6 respectively, afaik.
Side note to the x86 guys: I think it was a mistake (long long long
ago) to define these "valid when not present" bits in terms of the
"valid when present" bits.
It causes insane situations like this:
#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
which makes no sense *except* if you think that those bits can have
random odd hardware-defined values. But they really can't. They are
just random bit numbers we chose.
It has *also* caused horrible pain with the whole "soft dirty" thing,
and we have absolutely ridiculous macros in pgtable-2level.h for the
insane soft-dirty case, trying to keep the swap bits spread out "just
right" to make soft-dirty (_PAGE_BIT_HIDDEN aka bit 11) not alias with
the bits we use for swap offsets etc.
So how about we just say:
- define the bits we use when PAGE_PRESENT==0 separately and explicitly
- clean up the crazy soft-dirty crap, preferably by just making it
depend on a 64-bit pte (so you have to have X86_PAE enabled or be on
x86-64)
that would sound like a good cleanup, because right now it's a
complete nightmare to think about which bits are used how when P is 0.
The above insane #if being the prime example of that confusion.
Linus
--
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:[~2014-03-31 16:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1395425902-29817-1-git-send-email-david.vrabel@citrix.com>
[not found] ` <1395425902-29817-3-git-send-email-david.vrabel@citrix.com>
[not found] ` <533016CB.4090807@citrix.com>
[not found] ` <CAKbGBLiVqaHEOZx6y4MW4xDTUdKRhVLZXTTGiqYT7vuH2Wgeww@mail.gmail.com>
2014-03-25 20:16 ` Linus Torvalds
2014-03-31 12:26 ` Mel Gorman
2014-03-31 15:41 ` Linus Torvalds
2014-03-31 16:10 ` Linus Torvalds [this message]
2014-03-31 16:27 ` Cyrill Gorcunov
2014-04-01 18:18 ` David Vrabel
2014-04-01 18:43 ` Linus Torvalds
2014-04-01 19:03 ` Cyrill Gorcunov
2014-04-02 11:33 ` Pavel Emelyanov
2014-04-02 13:29 ` Cyrill Gorcunov
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=CA+55aFwM5GXr3m2GyL6-PWS-VepPO7HVN-311tM3tFDtDVuGYA@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=david.vrabel@citrix.com \
--cc=gorcunov@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=steven@uplinklabs.net \
--cc=x86@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