[PATCH 1/2] iosched: fix typo and barrier()
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Tue, 18 Apr 2006 07:44:06 +0000 (09:44 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 18 Apr 2006 07:44:06 +0000 (09:44 +0200)
commitfba822722e3f9d438fca8fd9541d7ddd447d7a48
tree05fc35428f61fb6b66726e3aae03ce9187212c21
parenta9a5cd5d2a57fb76dbae2115450f777b69beccf7
[PATCH 1/2] iosched: fix typo and barrier()

On rmmod path, cfq/as waits to make sure all io-contexts was
freed. However, it's using complete(), not wait_for_completion().

I think barrier() is not enough in here. To avoid the following case,
this patch replaces barrier() with smb_wmb().

cpu0 visibility cpu1
                [ioc_gnone=NULL,ioc_count=1]

ioc_gnone = &all_gone NULL,ioc_count=1
atomic_read(&ioc_count) NULL,ioc_count=1
wait_for_completion() NULL,ioc_count=0 atomic_sub_and_test()
NULL,ioc_count=0 if ( && ioc_gone)
    [ioc_gone==NULL,
    so doesn't call complete()]
   &all_gone,ioc_count=0

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Jens Axboe <axboe@suse.de>
block/as-iosched.c
block/cfq-iosched.c