]> www.infradead.org Git - users/hch/block.git/commit
blk-iocost: prevent configuration update concurrent with io throttling
authorYu Kuai <yukuai3@huawei.com>
Wed, 12 Oct 2022 09:40:34 +0000 (17:40 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 16 Oct 2022 23:19:19 +0000 (17:19 -0600)
commitf71da52a257b300e7f23a882628d724aa9b82f98
treeb1e7f8392840ea84e056f02e55c456a710d5a26f
parentd5777253bae5d43e50f5c30d7d32059e094fca55
blk-iocost: prevent configuration update concurrent with io throttling

This won't cause any severe problem currently, however, this doesn't
seems appropriate:

1) 'ioc->params' is read from multiple places without holding
'ioc->lock', unexpected value might be read if writing it concurrently.

2) If configuration is changed while io is throttling, the functionality
might be affected. For example, if module params is updated and cost
becomes smaller, waiting for timer that is caculated under old
configuration is not appropriate.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20221012094035.390056-4-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c