laptop-mode: Make flushes per-device

One of the features of laptop-mode is that it forces a writeout of dirty
pages if something else triggers a physical read or write from a device.
The current implementation flushes pages on all devices, rather than only
the one that triggered the flush. This patch alters the behaviour so that
only the recently accessed block device is flushed, preventing other
disks being spun up for no terribly good reason.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Matthew Garrett 2010-04-06 14:25:14 +02:00 committed by Jens Axboe
parent 9195291e5f
commit 31373d09da
4 changed files with 30 additions and 21 deletions

View file

@ -96,8 +96,10 @@ static inline void inode_sync_wait(struct inode *inode)
/*
* mm/page-writeback.c
*/
void laptop_io_completion(void);
void laptop_io_completion(struct backing_dev_info *info);
void laptop_sync_completion(void);
void laptop_mode_sync(struct work_struct *work);
void laptop_mode_timer_fn(unsigned long data);
void throttle_vm_writeout(gfp_t gfp_mask);
/* These are exported to sysctl. */