Messages in this thread | | | Date | Tue, 13 Dec 2005 23:07:58 +0200 | From | "Michael S. Tsirkin" <> | Subject | Re: set_page_dirty vs set_page_dirty_lock |
| |
Quoting Nick Piggin <nickpiggin@yahoo.com.au>: > > > >>or try to do something tricky with page_count to determine > >>if we need to do a copy in fork() rather than a COW. > > > > > > I'm actually reasonably happy with the trick that I'm using: > > performing a second get_user_pages after DMA and comparing > > the page lists. > > However, doing this every time on the off chance that a > > page was made COW forces me into task context, every time. > > > > I think it might be possible to solve it with the early-copy in > fork(). I'll tinker with it.
A possible way to do this would be adding an option to get_user_pages, and if selected, setting a flag on all pages in range. This flag should be cleared in put_page when the reference count drops to 1.
The only thing left would be to do the actual copy if the flag is set.
HTH,
-- MST - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |