writeback: dirty rate control
[cascardo/linux.git] / include / linux / backing-dev.h
index 3b2f9cb..dff0ff7 100644 (file)
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
 enum bdi_stat_item {
        BDI_RECLAIMABLE,
        BDI_WRITEBACK,
+       BDI_DIRTIED,
        BDI_WRITTEN,
        NR_BDI_STAT_ITEMS
 };
@@ -74,10 +75,17 @@ struct backing_dev_info {
        struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
 
        unsigned long bw_time_stamp;    /* last time write bw is updated */
+       unsigned long dirtied_stamp;
        unsigned long written_stamp;    /* pages written at bw_time_stamp */
        unsigned long write_bandwidth;  /* the estimated write bandwidth */
        unsigned long avg_write_bandwidth; /* further smoothed write bw */
 
+       /*
+        * The base dirty throttle rate, re-calculated on every 200ms.
+        * All the bdi tasks' dirty rate will be curbed under it.
+        */
+       unsigned long dirty_ratelimit;
+
        struct prop_local_percpu completions;
        int dirty_exceeded;