1
0
Fork 0
alistair23-linux/include
Artem Bityutskiy 080dcec417 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>
2010-08-07 18:53:56 +02:00
..
acpi ACPI: skip checking BM_STS if the BIOS doesn't ask for it 2010-07-22 16:54:27 -04:00
asm-generic Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2010-07-23 13:26:16 -07:00
crypto crypto: skcipher - Add ablkcipher_walk interfaces 2010-05-19 14:13:07 +10:00
drm drm/ttm: Allocate the page pool manager in the heap. 2010-07-07 12:14:11 +10:00
keys
linux writeback: simplify bdi code a little 2010-08-07 18:53:56 +02:00
math-emu math-emu: correct test for downshifting fraction in _FP_FROM_INT() 2010-07-20 18:45:14 -07:00
media V4L/DVB: tuner: Add a definition for the Philips FQ1236 MK5 NTSC tuner 2010-07-08 16:49:53 -03:00
mtd
net net sched: fix race in mirred device removal 2010-07-24 21:04:20 -07:00
pcmcia
rdma IB/core: Allow device-specific per-port sysfs files 2010-05-21 10:34:44 -07:00
rxrpc
scsi SCSI: implement sd_unlock_native_capacity() 2010-06-02 13:50:04 -04:00
sound Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-05-20 09:41:44 -07:00
trace writeback.h: needs linux/device.h 2010-08-07 18:26:35 +02:00
video fbdev: move FBIO_WAITFORVSYNC to linux/fb.h 2010-05-25 08:07:09 -07:00
xen
Kbuild