summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index e9a5ae25db8c..85d515935420 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -488,6 +488,21 @@ struct request_queue *blk_alloc_queue(gfp_t gfp_mask)
}
EXPORT_SYMBOL(blk_alloc_queue);
+static void laptop_mode_timer_fn(unsigned long data)
+{
+ struct request_queue *q = (struct request_queue *)data;
+ int nr_pages = global_page_state(NR_FILE_DIRTY) +
+ global_page_state(NR_UNSTABLE_NFS);
+
+ /*
+ * We want to write everything out, not just down to the dirty
+ * threshold
+ */
+
+ if (bdi_has_dirty_io(&q->backing_dev_info))
+ bdi_start_writeback(&q->backing_dev_info, NULL, nr_pages);
+}
+
struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
{
struct request_queue *q;