Re: memory management issues

James Bottomley <[email protected]>
Newsgroups gmane.linux.ports.hppa
Message-ID <[email protected]>
On Thu, 2007-05-03 at 01:11 -0700, Ollie Wild wrote:
> Is this a bug in get_user_pages()?  Should it be calling
> flush_cache_page() directly?

Just for the sake of completeness, the answer to this is "no".  The
anonymous page part of get_user_pages() is designed to gather pages from
current processes only (an then, the only in-tree user we have is fuse
and that's a bit of a hack).  The problem with your patch is that you're
trying to gather non-current pages.

It took me a while to discover this, largely because you do this:

+                               ret = get_user_pages(current, bprm->mm, pos,
+                                                    1, 1, 1, &page, NULL);

That's horribly wrong ... you can't use the current process context to
gather non-current pages ... if anything goes wrong and the page needs
faulting (unusual for a nascent process, but not impossible) you'll get
into terrible trouble because the mapping for the page isn't in current.

James
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.