diff options
author | Jan Kara <jack@suse.cz> | 2010-08-09 20:19:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:44:59 -0400 |
commit | f446daaea9d4a420d16c606f755f3689dcb2d0ce (patch) | |
tree | be2afc18f79aa4ff9be245b0a036aa06185b5dc4 /include/linux/fs.h | |
parent | ebf8aa44beed48cd17893a83d92a4403e5f9d9e2 (diff) |
mm: implement writeback livelock avoidance using page tagging
We try to avoid livelocks of writeback when some steadily creates dirty
pages in a mapping we are writing out. For memory-cleaning writeback,
using nr_to_write works reasonably well but we cannot really use it for
data integrity writeback. This patch tries to solve the problem.
The idea is simple: Tag all pages that should be written back with a
special tag (TOWRITE) in the radix tree. This can be done rather quickly
and thus livelocks should not happen in practice. Then we start doing the
hard work of locking pages and sending them to disk only for those pages
that have TOWRITE tag set.
Note: Adding new radix tree tag grows radix tree node from 288 to 296
bytes for 32-bit archs and from 552 to 560 bytes for 64-bit archs.
However, the number of slab/slub items per page remains the same (13 and 7
respectively).
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index e5106e49bd2c..488efec09d14 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -687,6 +687,7 @@ struct block_device { | |||
687 | */ | 687 | */ |
688 | #define PAGECACHE_TAG_DIRTY 0 | 688 | #define PAGECACHE_TAG_DIRTY 0 |
689 | #define PAGECACHE_TAG_WRITEBACK 1 | 689 | #define PAGECACHE_TAG_WRITEBACK 1 |
690 | #define PAGECACHE_TAG_TOWRITE 2 | ||
690 | 691 | ||
691 | int mapping_tagged(struct address_space *mapping, int tag); | 692 | int mapping_tagged(struct address_space *mapping, int tag); |
692 | 693 | ||