Under heavy memory pressure a PF_MEMALLOC task attemtps to write out a
blockdev page whose buffers are already under writeback and which were
dirtied while under writeback.
The writepage call returns -EAGAIN but because the caller is
PF_MEMALLOC, the page was not being marked dirty again.
The page sits on mapping->clean_pages for ever and it not written out.
The fix is to mark that page dirty again for all callers, regardless of
PF_MEMALLOC state.
fs/mpage.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
--- 25/fs/mpage.c~set_page_dirty-pf_memalloc Sun Oct 27 19:22:44 2002
+++ 25-akpm/fs/mpage.c Sun Oct 27 19:24:18 2002
@@ -591,6 +591,10 @@ mpage_writepages(struct address_space *m
test_clear_page_dirty(page)) {
if (writepage) {
ret = (*writepage)(page);
+ if (ret == -EAGAIN) {
+ __set_page_dirty_nobuffers(page);
+ ret = 0;
+ }
} else {
bio = mpage_writepage(bio, page, get_block,
&last_block_in_bio, &ret);
@@ -601,10 +605,6 @@ mpage_writepages(struct address_space *m
pagevec_deactivate_inactive(&pvec);
page = NULL;
}
- if (ret == -EAGAIN && page) {
- __set_page_dirty_nobuffers(page);
- ret = 0;
- }
if (ret || (--(wbc->nr_to_write) <= 0))
done = 1;
if (wbc->nonblocking && bdi_write_congested(bdi)) {
.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/