]> git.baikalelectronics.ru Git - kernel.git/commit
mm: direct IO starvation improvement
authorNick Piggin <npiggin@suse.de>
Tue, 6 Jan 2009 22:40:22 +0000 (14:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Jan 2009 23:59:09 +0000 (15:59 -0800)
commit8a022c71b84c143a83d11fb8397d3416fe5afd58
treeae99a8cb55b4d2716847521953db4bddd66b8e8b
parent4975e85ed31f8ab503b1ecd5caa653bdcaf536ea
mm: direct IO starvation improvement

Direct IO can invalidate and sync a lot of pagecache pages in the mapping.
 A 4K direct IO will actually try to sync and/or invalidate the pagecache
of the entire file, for example (which might be many GB or TB large).

Improve this by doing range syncs.  Also, memory no longer has to be
unmapped to catch the dirty bits for syncing, as dirty bits would remain
coherent due to dirty mmap accounting.

This fixes the immediate DM deadlocks when doing direct IO reads to block
device with a mounted filesystem, if only by papering over the problem
somewhat rather than addressing the fsync starvation cases.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c