Merge branch 'rmobile/dma' into rmobile-fixes-for-linus
[pandora-kernel.git] / include / linux / writeback.h
index 66862f2..f1bfa12 100644 (file)
@@ -7,6 +7,38 @@
 #include <linux/sched.h>
 #include <linux/fs.h>
 
+/*
+ * The 1/4 region under the global dirty thresh is for smooth dirty throttling:
+ *
+ *     (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
+ *
+ * The 1/16 region above the global dirty limit will be put to maximum pauses:
+ *
+ *     (limit, limit + limit/DIRTY_MAXPAUSE_AREA)
+ *
+ * The 1/16 region above the max-pause region, dirty exceeded bdi's will be put
+ * to loops:
+ *
+ *     (limit + limit/DIRTY_MAXPAUSE_AREA, limit + limit/DIRTY_PASSGOOD_AREA)
+ *
+ * Further beyond, all dirtier tasks will enter a loop waiting (possibly long
+ * time) for the dirty pages to drop, unless written enough pages.
+ *
+ * The global dirty threshold is normally equal to the global dirty limit,
+ * except when the system suddenly allocates a lot of anonymous memory and
+ * knocks down the global dirty threshold quickly, in which case the global
+ * dirty limit will follow down slowly to prevent livelocking all dirtier tasks.
+ */
+#define DIRTY_SCOPE            8
+#define DIRTY_FULL_SCOPE       (DIRTY_SCOPE / 2)
+#define DIRTY_MAXPAUSE_AREA            16
+#define DIRTY_PASSGOOD_AREA            8
+
+/*
+ * 4MB minimal write chunk size
+ */
+#define MIN_WRITEBACK_PAGES    (4096UL >> (PAGE_CACHE_SHIFT - 10))
+
 struct backing_dev_info;
 
 /*
@@ -84,6 +116,8 @@ static inline void laptop_sync_completion(void) { }
 #endif
 void throttle_vm_writeout(gfp_t gfp_mask);
 
+extern unsigned long global_dirty_limit;
+
 /* These are exported to sysctl. */
 extern int dirty_background_ratio;
 extern unsigned long dirty_background_bytes;
@@ -119,6 +153,10 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
                               unsigned long dirty);
 
 void __bdi_update_bandwidth(struct backing_dev_info *bdi,
+                           unsigned long thresh,
+                           unsigned long dirty,
+                           unsigned long bdi_thresh,
+                           unsigned long bdi_dirty,
                            unsigned long start_time);
 
 void page_writeback_init(void);