Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347831
b: refs/heads/master
c: 8c209ce
h: refs/heads/master
i:
  347829: be01844
  347827: 81dec8e
  347823: 5c60ad8
v: v3
  • Loading branch information
David Howells committed Dec 20, 2012
1 parent 0b1f3a8 commit 1bc5bd3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d76349d359064859217dc292dc8733e209705af
refs/heads/master: 8c209ce721444a61b61d9e772746c721e4d8d1e8
1 change: 1 addition & 0 deletions trunk/fs/fscache/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ extern atomic_t fscache_n_store_vmscan_not_storing;
extern atomic_t fscache_n_store_vmscan_gone;
extern atomic_t fscache_n_store_vmscan_busy;
extern atomic_t fscache_n_store_vmscan_cancelled;
extern atomic_t fscache_n_store_vmscan_wait;

extern atomic_t fscache_n_marks;
extern atomic_t fscache_n_uncaches;
Expand Down
19 changes: 14 additions & 5 deletions trunk/fs/fscache/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie,

_enter("%p,%p,%x", cookie, page, gfp);

try_again:
rcu_read_lock();
val = radix_tree_lookup(&cookie->stores, page->index);
if (!val) {
Expand Down Expand Up @@ -104,11 +105,19 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie,
return true;

page_busy:
/* we might want to wait here, but that could deadlock the allocator as
* the work threads writing to the cache may all end up sleeping
* on memory allocation */
fscache_stat(&fscache_n_store_vmscan_busy);
return false;
/* We will wait here if we're allowed to, but that could deadlock the
* allocator as the work threads writing to the cache may all end up
* sleeping on memory allocation, so we may need to impose a timeout
* too. */
if (!(gfp & __GFP_WAIT)) {
fscache_stat(&fscache_n_store_vmscan_busy);
return false;
}

fscache_stat(&fscache_n_store_vmscan_wait);
__fscache_wait_on_page_write(cookie, page);
gfp &= ~__GFP_WAIT;
goto try_again;
}
EXPORT_SYMBOL(__fscache_maybe_release_page);

Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/fscache/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ atomic_t fscache_n_store_vmscan_not_storing;
atomic_t fscache_n_store_vmscan_gone;
atomic_t fscache_n_store_vmscan_busy;
atomic_t fscache_n_store_vmscan_cancelled;
atomic_t fscache_n_store_vmscan_wait;

atomic_t fscache_n_marks;
atomic_t fscache_n_uncaches;
Expand Down Expand Up @@ -232,11 +233,12 @@ static int fscache_stats_show(struct seq_file *m, void *v)
atomic_read(&fscache_n_store_radix_deletes),
atomic_read(&fscache_n_store_pages_over_limit));

seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u\n",
seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u wt=%u\n",
atomic_read(&fscache_n_store_vmscan_not_storing),
atomic_read(&fscache_n_store_vmscan_gone),
atomic_read(&fscache_n_store_vmscan_busy),
atomic_read(&fscache_n_store_vmscan_cancelled));
atomic_read(&fscache_n_store_vmscan_cancelled),
atomic_read(&fscache_n_store_vmscan_wait));

seq_printf(m, "Ops : pend=%u run=%u enq=%u can=%u rej=%u\n",
atomic_read(&fscache_n_op_pend),
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,8 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
if (PagePrivate(page))
return -EBUSY;

nfs_fscache_release_page(page, GFP_KERNEL);
if (!nfs_fscache_release_page(page, GFP_KERNEL))
return -EBUSY;

return migrate_page(mapping, newpage, page, mode);
}
Expand Down

0 comments on commit 1bc5bd3

Please sign in to comment.