Re: can device drivers return non-ram via vm_ops->nopage?

From: Linus Torvalds
Date: Sun Mar 21 2004 - 16:54:55 EST




On Sun, 21 Mar 2004, David Woodhouse wrote:
>
> On Sun, 2004-03-21 at 20:49 +0000, Christoph Hellwig wrote:
> > And what exactly is a PFN without associated struct page supposed to mean?
>
> It's something you can put into a PTE, and that's about it. Which unless
> I'm misunderstanding ALSA/rmk's requirements, should be enough.

It would really be wrong to have nopage() return a pte. The thing is, the
VM really works on "struct page", all over the map. It does things like
"page_cache_release()" on the page if the file-backed VMA has been
truncated, and it just knows that the return value from "nopage()" has
_structure_.

Some architectures have per-page flags for things like "this page may need
to have icache flushed from it" etc.

So I really put my veto on "nopage()" returning a PFN. That's just wrong,
wrong, wrong. It returns a "struct page" pointer, and it has lots of
reasons for that.

And none of the reasons for _not_ doing it are valid, since such a user
can just pre-populate the page tables anyway.

So don't go there.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/