• OGAWA Hirofumi's avatar
    [PATCH 1/2] iosched: fix typo and barrier() · fba82272
    OGAWA Hirofumi authored
    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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: default avatarJens Axboe <axboe@suse.de>
    fba82272
cfq-iosched.c 57.4 KB