]> git.hungrycats.org Git - linux/commit
[PATCH] Make msync(MS_ASYNC) no longer start the I/O
authorAndrew Morton <akpm@digeo.com>
Wed, 9 Apr 2003 04:31:36 +0000 (21:31 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 9 Apr 2003 04:31:36 +0000 (21:31 -0700)
commita300bad22f3ae5811c0f1a5c5c8a95825b3d262d
treecb31f87f38909974c57fcad7df73ec7588b6599e
parent72c4f88a9d99432b1e3645d8ddccd17089a670c3
[PATCH] Make msync(MS_ASYNC) no longer start the I/O

MS_ASYNC will currently wait on previously-submitted I/O, then start new I/O
and not wait on it.  This can cause undesirable blocking if msync is called
rapidly against the same memory.

So instead, change msync(MS_ASYNC) to not start any IO at all.  Just flush
the pte dirty bits into the pageframe and leave it at that.

The IO _will_ happen within a kupdate period.  And the application can use
fsync() or fadvise(FADV_DONTNEED) if it actually wants to schedule the IO
immediately.

(This has triggered an ext3 bug - the page's buffers get dirtied so fast
that kjournald keeps writing the buffers over and over for 10-20 seconds
before deciding to give up for some reason)
mm/msync.c