Re: [PATCH 1/1] Document get_user_pages_fast()

From: KOSAKI Motohiro
Date: Thu Apr 09 2009 - 23:27:36 EST


> > There is one problem.
> > gup and get_page() don't provide any page pinning.
> >
> > get_page() only gurantee not freed. but don't gurantee to prevent page
> > reclaim
>
> is_page_cache_freeable() measures page_count()...

sorry, my explanation was too short.

reclaim can unmap the page. but page migration assume unmap successing mean
page migratable, then user-address associate another page and lost writing data
to old page.

IOW

CPU0 CPU1 note
------------------------------------------------------
gup()
page-migration user-address attach another page
write data to write to old page.
gup()ed page userland can't see it.

put_page() free old page.


>
> > and Cow change owner process.
>
> hm. buggy userspace? Why is that a problem from a kernel perspective?

We already started to discuttion in "[PATCH] fork vs gup(-fast) fix" thread.
but this is very difficult problem. it is still in progress ;)



> > Yes, current all gup caller have serious bug. especially direct-io, aio, bio
> > are broken.



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