diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
commit | a57cb1c1d7974c62a5c80f7869e35b492ace12cd (patch) | |
tree | 5a42ee9a668f171143464bc86013954c1bbe94ad /mm/page-writeback.c | |
parent | cf1b3341afab9d3ad02a76b3a619ea027dcf4e28 (diff) | |
parent | e1e14ab8411df344a17687821f8f78f0a1e73cbb (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
- a few misc things
- kexec updates
- DMA-mapping updates to better support networking DMA operations
- IPC updates
- various MM changes to improve DAX fault handling
- lots of radix-tree changes, mainly to the test suite. All leading up
to reimplementing the IDA/IDR code to be a wrapper layer over the
radix-tree. However the final trigger-pulling patch is held off for
4.11.
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
radix tree test suite: delete unused rcupdate.c
radix tree test suite: add new tag check
radix-tree: ensure counts are initialised
radix tree test suite: cache recently freed objects
radix tree test suite: add some more functionality
idr: reduce the number of bits per level from 8 to 6
rxrpc: abstract away knowledge of IDR internals
tpm: use idr_find(), not idr_find_slowpath()
idr: add ida_is_empty
radix tree test suite: check multiorder iteration
radix-tree: fix replacement for multiorder entries
radix-tree: add radix_tree_split_preload()
radix-tree: add radix_tree_split
radix-tree: add radix_tree_join
radix-tree: delete radix_tree_range_tag_if_tagged()
radix-tree: delete radix_tree_locate_item()
radix-tree: improve multiorder iterators
btrfs: fix race in btrfs_free_dummy_fs_info()
radix-tree: improve dump output
radix-tree: make radix_tree_find_next_bit more useful
...
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 52e2f8e3b472..290e8b7d3181 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -2106,18 +2106,26 @@ void tag_pages_for_writeback(struct address_space *mapping, | |||
2106 | pgoff_t start, pgoff_t end) | 2106 | pgoff_t start, pgoff_t end) |
2107 | { | 2107 | { |
2108 | #define WRITEBACK_TAG_BATCH 4096 | 2108 | #define WRITEBACK_TAG_BATCH 4096 |
2109 | unsigned long tagged; | 2109 | unsigned long tagged = 0; |
2110 | 2110 | struct radix_tree_iter iter; | |
2111 | do { | 2111 | void **slot; |
2112 | spin_lock_irq(&mapping->tree_lock); | 2112 | |
2113 | tagged = radix_tree_range_tag_if_tagged(&mapping->page_tree, | 2113 | spin_lock_irq(&mapping->tree_lock); |
2114 | &start, end, WRITEBACK_TAG_BATCH, | 2114 | radix_tree_for_each_tagged(slot, &mapping->page_tree, &iter, start, |
2115 | PAGECACHE_TAG_DIRTY, PAGECACHE_TAG_TOWRITE); | 2115 | PAGECACHE_TAG_DIRTY) { |
2116 | if (iter.index > end) | ||
2117 | break; | ||
2118 | radix_tree_iter_tag_set(&mapping->page_tree, &iter, | ||
2119 | PAGECACHE_TAG_TOWRITE); | ||
2120 | tagged++; | ||
2121 | if ((tagged % WRITEBACK_TAG_BATCH) != 0) | ||
2122 | continue; | ||
2123 | slot = radix_tree_iter_resume(slot, &iter); | ||
2116 | spin_unlock_irq(&mapping->tree_lock); | 2124 | spin_unlock_irq(&mapping->tree_lock); |
2117 | WARN_ON_ONCE(tagged > WRITEBACK_TAG_BATCH); | ||
2118 | cond_resched(); | 2125 | cond_resched(); |
2119 | /* We check 'start' to handle wrapping when end == ~0UL */ | 2126 | spin_lock_irq(&mapping->tree_lock); |
2120 | } while (tagged >= WRITEBACK_TAG_BATCH && start); | 2127 | } |
2128 | spin_unlock_irq(&mapping->tree_lock); | ||
2121 | } | 2129 | } |
2122 | EXPORT_SYMBOL(tag_pages_for_writeback); | 2130 | EXPORT_SYMBOL(tag_pages_for_writeback); |
2123 | 2131 | ||