* Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1
@ 2008-08-27 19:02 Jeremy Fitzhardinge
2008-08-28 0:32 ` Nick Piggin
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2008-08-27 19:02 UTC (permalink / raw)
To: Nick Piggin
Cc: Ingo Molnar, Hugh Dickens, Linux Kernel Mailing List,
Andrew Morton, Linux Memory Management List
_PAGE_SPECIAL is overloading _PAGE_UNUSED1. Does it really leave
_PAGE_UNUSED1 available for other uses, or does it become an exclusive
user of that flag. Under what circumstances can they be shared?
arch/x86/mm/pageattr-test.c is now using _PAGE_UNUSED1 as the flag used
to make sure that huge pages are shattered properly (previously it used
_PAGE_GLOBAL). Is that going to clash with _PAGE_SPECIAL?
In other words, should we drop _PAGE_UNUSED1 altogether, or at least
define how the its different users can coexist?
Am I right in supposing that _PAGE_SPECIAL can only be set on user pages?
(Also, "SPECIAL" is awfully generic. Was there really no more
descriptive name for this?)
J
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1
2008-08-27 19:02 Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1 Jeremy Fitzhardinge
@ 2008-08-28 0:32 ` Nick Piggin
2008-08-28 0:47 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 4+ messages in thread
From: Nick Piggin @ 2008-08-28 0:32 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Ingo Molnar, Hugh Dickens, Linux Kernel Mailing List,
Andrew Morton, Linux Memory Management List
On Thursday 28 August 2008 05:02, Jeremy Fitzhardinge wrote:
> _PAGE_SPECIAL is overloading _PAGE_UNUSED1. Does it really leave
> _PAGE_UNUSED1 available for other uses, or does it become an exclusive
> user of that flag. Under what circumstances can they be shared?
>
> arch/x86/mm/pageattr-test.c is now using _PAGE_UNUSED1 as the flag used
> to make sure that huge pages are shattered properly (previously it used
> _PAGE_GLOBAL). Is that going to clash with _PAGE_SPECIAL?
Ah... pity it was hidden away there and not put into the include file.
> In other words, should we drop _PAGE_UNUSED1 altogether, or at least
> define how the its different users can coexist?
I don't feel strongly about it. But you should put your definition in
pgtable.h (and possibly explain how it coexists with _SPECIAL).
> Am I right in supposing that _PAGE_SPECIAL can only be set on user pages?
Yes.
> (Also, "SPECIAL" is awfully generic. Was there really no more
> descriptive name for this?)
I thought it was about on par with its counterpart, which is "normal".
Either way, I don't think a casual reader would get an adequate idea
of how it works in one word. normal ~= refcounted, special ~= !refcounted
I guess, but it is slightly more than that and besides, normal was there
first, and I think Linus coined it... if you can convince him to change
it then you have my blessing to change special into whatever you want.
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1
2008-08-28 0:32 ` Nick Piggin
@ 2008-08-28 0:47 ` Jeremy Fitzhardinge
2008-08-28 1:00 ` Nick Piggin
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2008-08-28 0:47 UTC (permalink / raw)
To: Nick Piggin
Cc: Ingo Molnar, Hugh Dickens, Linux Kernel Mailing List,
Andrew Morton, Linux Memory Management List
Nick Piggin wrote:
> Ah... pity it was hidden away there and not put into the include file.
>
Yes. I just prepped a patch to bring it out into the light.
> I don't feel strongly about it. But you should put your definition in
> pgtable.h (and possibly explain how it coexists with _SPECIAL).
>
Yes, that was my plan, but without knowing how _SPECIAL is used, it's a
bit tricky. Is there a comment somewhere which describes who sets it
and when? From a quick look, it seems it's set on newly added user
pages which aren't COWed. Can they be shared file-backed pages?
Anonymous pages? Device pages?
>> Am I right in supposing that _PAGE_SPECIAL can only be set on user pages?
>>
>
> Yes.
>
OK, that won't clash with CPA tests at all, since they're kernel only.
>> (Also, "SPECIAL" is awfully generic. Was there really no more
>> descriptive name for this?)
>>
>
> I thought it was about on par with its counterpart, which is "normal".
> Either way, I don't think a casual reader would get an adequate idea
> of how it works in one word. normal ~= refcounted, special ~= !refcounted
> I guess, but it is slightly more than that and besides, normal was there
> first, and I think Linus coined it... if you can convince him to change
> it then you have my blessing to change special into whatever you want.
>
It's only used in a couple of places, so giving it a longer name
wouldn't cost much. _PAGE_USER_UNCOUNTED? But ugh, a lot of cross-arch
churnpatch to do it.
J
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1
2008-08-28 0:47 ` Jeremy Fitzhardinge
@ 2008-08-28 1:00 ` Nick Piggin
0 siblings, 0 replies; 4+ messages in thread
From: Nick Piggin @ 2008-08-28 1:00 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Ingo Molnar, Hugh Dickens, Linux Kernel Mailing List,
Andrew Morton, Linux Memory Management List
On Thursday 28 August 2008 10:47, Jeremy Fitzhardinge wrote:
> Nick Piggin wrote:
> > Ah... pity it was hidden away there and not put into the include file.
>
> Yes. I just prepped a patch to bring it out into the light.
>
> > I don't feel strongly about it. But you should put your definition in
> > pgtable.h (and possibly explain how it coexists with _SPECIAL).
>
> Yes, that was my plan, but without knowing how _SPECIAL is used, it's a
> bit tricky. Is there a comment somewhere which describes who sets it
> and when? From a quick look, it seems it's set on newly added user
> pages which aren't COWed. Can they be shared file-backed pages?
> Anonymous pages? Device pages?
They'll tend to be device pages. XIP filesystem mappings can set it too.
They won't be set on anonymous pages, or on normally mmap()ed pagecache
pages (although best not to take the latter as a strict rule because
in theory a filesystem _could_ map a pagecache page).
> >> Am I right in supposing that _PAGE_SPECIAL can only be set on user
> >> pages?
> >
> > Yes.
>
> OK, that won't clash with CPA tests at all, since they're kernel only.
Right. But they could nearly have clashed without ever being set on
kernel ptes -- if we ever _tested_ kernel ptes for that bit (gup.c
has other safeguards that should keep us away from kernel pages, but
it could in theory be implemented on x86 by only testing _PTE_SPECIAL
if we know it won't be set on kernel ptes).
But if we just document the fact now that _PTE_SPECIAL is valid for
only user ptes, then I think your CPA test bit fits nicely into the
kernel side and we're no longer wasting half a bit ;)
> >> (Also, "SPECIAL" is awfully generic. Was there really no more
> >> descriptive name for this?)
> >
> > I thought it was about on par with its counterpart, which is "normal".
> > Either way, I don't think a casual reader would get an adequate idea
> > of how it works in one word. normal ~= refcounted, special ~= !refcounted
> > I guess, but it is slightly more than that and besides, normal was there
> > first, and I think Linus coined it... if you can convince him to change
> > it then you have my blessing to change special into whatever you want.
>
> It's only used in a couple of places, so giving it a longer name
> wouldn't cost much. _PAGE_USER_UNCOUNTED? But ugh, a lot of cross-arch
> churnpatch to do it.
And you have to get Linus to accept a patch turning vm_normal_page into
vm_user_counted. Good luck :)
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-08-28 1:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-27 19:02 Definition of x86 _PAGE_SPECIAL and sharing _PAGE_UNUSED1 Jeremy Fitzhardinge
2008-08-28 0:32 ` Nick Piggin
2008-08-28 0:47 ` Jeremy Fitzhardinge
2008-08-28 1:00 ` Nick Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox