2015-12-28 18:38:01

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH 1/2] NFS: Background flush should not be low priority

Background flush is needed in order to satisfy the global page limits.
Don't subvert by reducing the priority.
This should also address a write starvation issue that was reported by
Neil Brown.

Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfs/write.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 7b9316406930..7a4fe7d82e65 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -247,8 +247,6 @@ static int wb_priority(struct writeback_control *wbc)
return FLUSH_HIGHPRI | FLUSH_STABLE;
if (wbc->sync_mode == WB_SYNC_ALL)
ret = FLUSH_COND_STABLE;
- if (wbc->for_kupdate || wbc->for_background)
- ret |= FLUSH_LOWPRI;
return ret;
}

--
2.5.0



2015-12-28 18:38:03

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH 2/2] NFS: Flush reclaim writes using FLUSH_COND_STABLE

If there are already writes queued up for commit, then don't flush
just this page even if it is a reclaim issue.

Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfs/write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 7a4fe7d82e65..1ea35f88eadb 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -244,7 +244,7 @@ static int wb_priority(struct writeback_control *wbc)
{
int ret = 0;
if (wbc->for_reclaim)
- return FLUSH_HIGHPRI | FLUSH_STABLE;
+ return FLUSH_HIGHPRI | FLUSH_COND_STABLE;
if (wbc->sync_mode == WB_SYNC_ALL)
ret = FLUSH_COND_STABLE;
return ret;
--
2.5.0