Nick Piggin writes: > > > Nikita Danilov wrote: > > >Hugh Dickins writes: > > > On Wed, 4 Feb 2004, Nikita Danilov wrote: > > > > Hugh Dickins writes: > > > > > If you go the writepage-while-mapped route (more general gotchas? > > > > > I forget), you'll have to make an exception for shmem_writepage. > > > > > > > > May be one can just call try_to_unmap() from shmem_writepage()? > > > > > > That sounds much cleaner. But I've not yet found what tree your > > > p12-dont-unmap-on-pageout.patch applies to, so cannot judge it. > > > >Whole > >ftp://ftp.namesys.com/pub/misc-patches/unsupported/extra/2004.02.04/ > >applies to the 2.6.2-rc2. > > > >I just updated p12-dont-unmap-on-pageout.patch in-place. > > > > > > > > Sure, I can give this a try. It makes sense. > To my surprise I have just found that ftp://ftp.namesys.com/pub/misc-patches/unsupported/extra/2004.02.04/p10-trasnfer-dirty-on-refill.patch [yes, I know there is a typo in the name.] patch improves performance quite measurably. It implements a suggestion made in the comment in refill_inactive_zone(): /* * probably it would be useful to transfer dirty bit * from pte to the @page here. */ To do this page_is_dirty() function is used (the same one as used by dont-unmap-on-pageout.patch), which is implemented in check-pte-dirty.patch. I ran $ time build.sh 10 11 (attached) and get following elapsed time: without patch: 3818.320, with patch: 3368.690 (11% improvement). As I see it, early transfer of dirtiness to the struct page allows to do more write-back through ->writepages() which is much more efficient way than single-page ->writepage. Nikita.