From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Thomas Hellström" <thomas@tungstengraphics.com>,
linux-mm@kvack.org,
"Linux Kernel list" <linux-kernel@vger.kernel.org>,
"Hugh Dickins" <hugh@veritas.com>,
"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: User switchable HW mappings & cie
Date: Tue, 10 Oct 2006 07:06:23 +1000 [thread overview]
Message-ID: <1160427983.7752.24.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0610091151380.3952@g5.osdl.org>
> Anyway, so right now you can use "vm_insert_page()" and it will increment
> the page count and add things to the rmap lists, which is what current
> users want. But if you don't have a normal page, you should be able to
> basically avoid that part entirely, and just use
>
> set_pte_at(mm, addr, pte, make-up-a-pte-here);
>
> and you're done (of course, you need to use all the appropriate magic to
> set up the pte, ie you'd normally have something like
>
> pte = get_locked_pte(mm, addr, &ptl);
> ..
> pte_unmap_unlock(pte, ptl);
>
> around it). Note that "vm_insert_page()" is _not_ for VM_PFNMAP mappings,
> exactly because it does actually increment page counts. It's for a
> "normal" mapping that just wants to insert a reference-counted page.
Yes, that's why we want a vm_insert_pfn() as I really don't want to see
PTE manipulations proliferate in drivers :) Nick is coming up with an
implementation faster than I can think about the code anyway ;)
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Thomas Hellström" <thomas@tungstengraphics.com>,
linux-mm@kvack.org,
"Linux Kernel list" <linux-kernel@vger.kernel.org>,
"Hugh Dickins" <hugh@veritas.com>,
"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: User switchable HW mappings & cie
Date: Tue, 10 Oct 2006 07:06:23 +1000 [thread overview]
Message-ID: <1160427983.7752.24.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0610091151380.3952@g5.osdl.org>
> Anyway, so right now you can use "vm_insert_page()" and it will increment
> the page count and add things to the rmap lists, which is what current
> users want. But if you don't have a normal page, you should be able to
> basically avoid that part entirely, and just use
>
> set_pte_at(mm, addr, pte, make-up-a-pte-here);
>
> and you're done (of course, you need to use all the appropriate magic to
> set up the pte, ie you'd normally have something like
>
> pte = get_locked_pte(mm, addr, &ptl);
> ..
> pte_unmap_unlock(pte, ptl);
>
> around it). Note that "vm_insert_page()" is _not_ for VM_PFNMAP mappings,
> exactly because it does actually increment page counts. It's for a
> "normal" mapping that just wants to insert a reference-counted page.
Yes, that's why we want a vm_insert_pfn() as I really don't want to see
PTE manipulations proliferate in drivers :) Nick is coming up with an
implementation faster than I can think about the code anyway ;)
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>
next prev parent reply other threads:[~2006-10-09 21:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-08 22:37 User switchable HW mappings & cie Benjamin Herrenschmidt
2006-10-08 22:37 ` Benjamin Herrenschmidt
2006-10-09 11:43 ` Thomas Hellström
2006-10-09 11:43 ` Thomas Hellström
2006-10-09 11:51 ` Benjamin Herrenschmidt
2006-10-09 11:51 ` Benjamin Herrenschmidt
2006-10-09 12:00 ` Nick Piggin
2006-10-09 12:00 ` Nick Piggin
2006-10-09 18:36 ` Ingo Oeser
2006-10-09 18:36 ` Ingo Oeser
2006-10-09 21:03 ` Benjamin Herrenschmidt
2006-10-09 21:03 ` Benjamin Herrenschmidt
2006-10-09 19:14 ` Linus Torvalds
2006-10-09 19:14 ` Linus Torvalds
2006-10-09 21:06 ` Benjamin Herrenschmidt [this message]
2006-10-09 21:06 ` Benjamin Herrenschmidt
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=1160427983.7752.24.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=arnd@arndb.de \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=thomas@tungstengraphics.com \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.