aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/backing-dev.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-07-25 07:29:16 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:53:56 -0400
commit080dcec41709be72613133f695be75b98dd43e88 (patch)
tree8f453a9fe9b2a144662aad4e06944722610a1056 /include/linux/backing-dev.h
parent297252c81de8043ca6c36e5984c24fdb5aab9013 (diff)
writeback: simplify bdi code a little
This patch simplifies bdi code a little by removing the 'pending_list' which is redundant. Indeed, currently the forker thread ('bdi_forker_thread()') is working like this: 1. In a loop, fetch all bdi's which have works but have no writeback thread and move them to the 'pending_list'. 2. If the list is empty, sleep for 5 sec. 3. Otherwise, take one bdi from the list, fork the writeback thread for this bdi, and repeat the loop. IOW, it first moves everything to the 'pending_list', then process only one element, and so on. This patch simplifies the algorithm, which is now as follows. 1. Find the first bdi which has a work and remove it from the global list of bdi's (bdi_list). 2. If there was not such bdi, sleep 5 sec. 3. Fork the writeback thread for this bdi and repeat the loop. IOW, now we find the first bdi to process, process it, and so on. This is simpler and involves less lists. The bonus now is that we can get rid of a couple of functions, as well as remove complications which involve 'rcu_call()' and 'bdi->rcu_head'. This patch also makes sure we use 'list_add_tail_rcu()', instead of plain 'list_add_tail()', but this piece of code is going to be removed in the next patch anyway. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include/linux/backing-dev.h')
-rw-r--r--include/linux/backing-dev.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index f0936f5f85dd..95ecb2bebca8 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -58,7 +58,6 @@ struct bdi_writeback {
58 58
59struct backing_dev_info { 59struct backing_dev_info {
60 struct list_head bdi_list; 60 struct list_head bdi_list;
61 struct rcu_head rcu_head;
62 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ 61 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
63 unsigned long state; /* Always use atomic bitops on this */ 62 unsigned long state; /* Always use atomic bitops on this */
64 unsigned int capabilities; /* Device capabilities */ 63 unsigned int capabilities; /* Device capabilities */