I've also merged Nick's "mm: madvise avoid exclusive mmap_sem".
- Nick's patch also will help this problem. It could be that your patch
no longer offers a 2x speedup when combined with Nick's patch.
It could well be that the combination of the two is even better, but it
would be nice to firm that up a bit.
I do go on about that. But we're adding page flags at about one per
year, and when we run out we're screwed - we'll need to grow the
pageframe.
- I need to update your patch for Nick's patch. Please confirm that
down_read(mmap_sem) is sufficient for MADV_FREE.
Stylistic nit:
+ if (PageLazyFree(page) && !migration) {
+ /* There is new data in the page. Reinstate it. */
+ if (unlikely(pte_dirty(pteval))) {
+ set_pte_at(mm, address, pte, pteval);
+ ret = SWAP_FAIL;
+ goto out_unmap;
+ }
The comment should be inside the second `if' statement. As it is, It
looks like we reinstate the page if (PageLazyFree(page) && !migration).