Re: Nick's core remove PageReserved broke vmware...

From: Benjamin Herrenschmidt
Date: Wed Nov 02 2005 - 17:25:23 EST


On Wed, 2005-11-02 at 22:02 +0000, Hugh Dickins wrote:

> I wish everyone else would see it that way! (But some people do
> have valid scenarios where it can't just be ruled out completely.)

Hehe, well, in my case it's not one, at least not yet :)

> > > Take a look at Andrew's educational comment on set_page_dirty_lock
> > > in mm/page-writeback.c. You do have the list of pages you need to
> > > page_cache_release, don't you? So it should be easy to dirty them.
> >
> > Ok, so just passing 'write' to get_user_pages() is good enough; right ?
>
> Not quite, I think: you need to pass 'write' to get_user_pages()
> initially; but at the end, if it was indeed writing into user space,
> you need to do the set_page_dirty_lock thing on each of the pages
> before page_cache_release, just in case a race cleaned them before
> the DMA completed. I think (I've never used it myself).

Oh, I see... I can't prevent them from being cleaned during the DMA
then... Ok, will do that.

Also, what do you suggest as a good threshold to use on the max amount
of memory I can let the X server "pin" that way ? I was thinking it as
equivalent to mlock, thus I could maybe hijack mm->locked_vm & use
RLIMIT_MEMLOCK or is that too gross ?

Ben.



-
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/