]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/fs-writeback.c
brcm80211: Use normal DEBUG define
[mirror_ubuntu-artful-kernel.git] / fs / fs-writeback.c
index 80a4574028f106f76db786033f95972f33e39bab..f855916657ba910f676eeb72ad795317c62fcbd5 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
+#include <linux/pagemap.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
 #include <linux/writeback.h>
 #include <linux/tracepoint.h>
 #include "internal.h"
 
+/*
+ * 4MB minimal write chunk size
+ */
+#define MIN_WRITEBACK_PAGES    (4096UL >> (PAGE_CACHE_SHIFT - 10))
+
 /*
  * Passed into wb_writeback(), essentially a subset of writeback_control
  */
@@ -742,11 +748,17 @@ static long wb_writeback(struct bdi_writeback *wb,
                if (work->for_background && !over_bground_thresh(wb->bdi))
                        break;
 
+               /*
+                * Kupdate and background works are special and we want to
+                * include all inodes that need writing. Livelock avoidance is
+                * handled by these works yielding to any other work so we are
+                * safe.
+                */
                if (work->for_kupdate) {
                        oldest_jif = jiffies -
                                msecs_to_jiffies(dirty_expire_interval * 10);
-                       work->older_than_this = &oldest_jif;
-               }
+               } else if (work->for_background)
+                       oldest_jif = jiffies;
 
                trace_writeback_start(wb->bdi, work);
                if (list_empty(&wb->b_io))
@@ -936,7 +948,7 @@ int bdi_writeback_thread(void *data)
 
        trace_writeback_thread_start(bdi);
 
-       while (!kthread_should_stop()) {
+       while (!kthread_freezable_should_stop(NULL)) {
                /*
                 * Remove own delayed wake-up timer, since we are already awake
                 * and we'll take care of the preriodic write-back.
@@ -966,8 +978,6 @@ int bdi_writeback_thread(void *data)
                         */
                        schedule();
                }
-
-               try_to_freeze();
        }
 
        /* Flush any work that raced with us exiting */