writeback: introduce wbc.for_background
authorWu Fengguang <fengguang.wu@gmail.com>
Thu, 3 Dec 2009 12:54:25 +0000 (13:54 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 3 Dec 2009 12:54:25 +0000 (13:54 +0100)
It will lower the flush priority for NFS, and maybe more in future.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/fs-writeback.c
fs/nfs/write.c
include/linux/writeback.h

index 0306c8e7d6b54b7449dd19497953a875d2b04990..0793961f76993716cad7c3cf3a388b7c6a6cee19 100644 (file)
@@ -738,6 +738,7 @@ static long wb_writeback(struct bdi_writeback *wb,
                .sync_mode              = args->sync_mode,
                .older_than_this        = NULL,
                .for_kupdate            = args->for_kupdate,
+               .for_background         = args->for_background,
                .range_cyclic           = args->range_cyclic,
        };
        unsigned long oldest_jif;
index 53eb26c16b50a06c0126f156a1ee6fddc1480413..c84b5cc1a943570ac9cba1fbf130288bcefe65e8 100644 (file)
@@ -178,7 +178,7 @@ static int wb_priority(struct writeback_control *wbc)
 {
        if (wbc->for_reclaim)
                return FLUSH_HIGHPRI | FLUSH_STABLE;
-       if (wbc->for_kupdate)
+       if (wbc->for_kupdate || wbc->for_background)
                return FLUSH_LOWPRI;
        return 0;
 }
index 66ebddcff6641f95498aa3c2e7af07cbffaa3a29..705f01fe413a5f982538bf58fe6c524f4828635a 100644 (file)
@@ -49,6 +49,7 @@ struct writeback_control {
        unsigned nonblocking:1;         /* Don't get stuck on request queues */
        unsigned encountered_congestion:1; /* An output: a queue is full */
        unsigned for_kupdate:1;         /* A kupdate writeback */
+       unsigned for_background:1;      /* A background writeback */
        unsigned for_reclaim:1;         /* Invoked from the page allocator */
        unsigned range_cyclic:1;        /* range_start is cyclic */
        unsigned more_io:1;             /* more io to be dispatched */