Commit 81c43a8d authored by Stephen Lord's avatar Stephen Lord

[XFS] remove some unbounded loops from the unwritten and unmapped page

processing code. As files get larger, these code paths have the
potential to hog the cpu for long periods of time. Just cap the
unmapped page case, and the unwritten one is supposed to be
stopping at the end of the extent anyway.

SGI Modid: 2.5.x-xfs:slinx:141609a
parent cd4816fe
......@@ -288,6 +288,8 @@ probe_unmapped_cluster(
*/
if (bh == head) {
tlast = inode->i_size >> PAGE_CACHE_SHIFT;
/* Prune this back to avoid pathological behavior */
tlast = min(tlast, startpage->index + 64);
for (tindex = startpage->index + 1; tindex < tlast; tindex++) {
len = probe_unmapped_page(mapping, tindex,
PAGE_CACHE_SIZE);
......@@ -405,6 +407,7 @@ map_unwritten(
struct page *page;
tlast = inode->i_size >> PAGE_CACHE_SHIFT;
tlast = min(tlast, start_page->index + pb->pb_page_count - 1);
for (tindex = start_page->index + 1; tindex < tlast; tindex++) {
page = probe_unwritten_page(mapping, tindex, mp, pb,
PAGE_CACHE_SIZE, &bs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment