summaryrefslogtreecommitdiff
path: root/include/linux/backing-dev-defs.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-22 17:13:35 -0400
committerJens Axboe <axboe@fb.com>2015-06-02 08:33:35 -0600
commit4aa9c692e052cf6db99db62a8fe0543e5c455da7 (patch)
tree378d5b44e7ec769dd4dfc9ac5ab2447fdb1f50a4 /include/linux/backing-dev-defs.h
parent8395cd9f813d5d7ed9870e642230acfcfc1e8a0a (diff)
downloadlwn-4aa9c692e052cf6db99db62a8fe0543e5c455da7.tar.gz
lwn-4aa9c692e052cf6db99db62a8fe0543e5c455da7.zip
bdi: separate out congested state into a separate struct
Currently, a wb's (bdi_writeback) congestion state is carried in its ->state field; however, cgroup writeback support will require multiple wb's sharing the same congestion state. This patch separates out congestion state into its own struct - struct bdi_writeback_congested. A new field wb field, wb_congested, points to its associated congested struct. The default wb, bdi->wb, always points to bdi->wb_congested. While this patch adds a layer of indirection, it doesn't introduce any behavior changes. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/backing-dev-defs.h')
-rw-r--r--include/linux/backing-dev-defs.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index aa18c4bd43c1..9e9eafa5f5aa 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -16,12 +16,15 @@ struct dentry;
* Bits in bdi_writeback.state
*/
enum wb_state {
- WB_async_congested, /* The async (write) queue is getting full */
- WB_sync_congested, /* The sync queue is getting full */
WB_registered, /* bdi_register() was done */
WB_writeback_running, /* Writeback is in progress */
};
+enum wb_congested_state {
+ WB_async_congested, /* The async (write) queue is getting full */
+ WB_sync_congested, /* The sync queue is getting full */
+};
+
typedef int (congested_fn)(void *, int);
enum wb_stat_item {
@@ -34,6 +37,10 @@ enum wb_stat_item {
#define WB_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))
+struct bdi_writeback_congested {
+ unsigned long state; /* WB_[a]sync_congested flags */
+};
+
struct bdi_writeback {
struct backing_dev_info *bdi; /* our parent bdi */
@@ -48,6 +55,8 @@ struct bdi_writeback {
struct percpu_counter stat[NR_WB_STAT_ITEMS];
+ struct bdi_writeback_congested *congested;
+
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 */
@@ -84,6 +93,7 @@ struct backing_dev_info {
unsigned int max_ratio, max_prop_frac;
struct bdi_writeback wb; /* default writeback info for this bdi */
+ struct bdi_writeback_congested wb_congested;
struct device *dev;