linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Memory Management <linux-mm@kvack.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: VM_RESERVED vs vm_normal_page()
Date: Wed, 13 Dec 2006 15:37:57 +1100	[thread overview]
Message-ID: <1165984677.11914.159.camel@localhost.localdomain> (raw)

Hi folks !

What is the logic regarding VM_RESERVED, and more specifically, why is
vm_normal_page() nor returning NULL for these ?

I have struct pages that are a bit special for things like SPE mappings
on Cell and I'd like to avoid a lot of the stuff the VM tries to do on
them, like rmap accounting, etc... In fact, for almost everything, the
semantics I want are vm_normal_page() to return NULL... I have struct
pages because for now I need do_no_page() to work, but I must absolutely
avoid things like getting swapped out etc...

Thus I looked at the logic in vm_normal_page() and it really sucks...
this is pretty much a "heuristic" to differenciate remap_page_range from
copy_on_write stuff ... gack.

What is VM_RESERVED for then ? Could I just use that ? I currently only
have VM_IO set on my SPE VMAs but I could add it. The current
implementation of vm_normal_page() doesn't test for it though, maybe it
should ?

I have still a problem though, in the case vm_normal_page() is made to
return NULL...

In that case, unmapping of pages will still cause them to be released
(tlb_* -> free_pages_and_swap_cache -> release_pages ->
put_page_testzero) but if you fork(), copy_one_pte() will not call an
additional get_page() when vm_normal_page() returns NULL... thus I fear
the page count will become bocus accross forks...

In the long run, I want to stop using struct page's for the SPU
registers and local store, once Nick's new stuff gets in, though I might
have a go at hacking something together before... but in the meantime,
I'd like to figure out what is the _safe_ way of having a VMA containing
PTEs mapping to struct pages that are _not_ normal memory and thus
aren't to be swapped out, freed, or anything like that.

Cheers,
Ben. 

--
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:[~2006-12-13  4:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-13  4:37 Benjamin Herrenschmidt [this message]
2006-12-13 13:20 ` Robin Holt

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=1165984677.11914.159.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --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