X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=block%2Fblk-iocost.c;h=7ee8d85c2c68deef726daf5fece28d9b9c4cc164;hb=refs%2Fheads%2Fsandbox%2Fklewandowski%2Frpi5;hp=089fcb9cfce37011f4cf6ec1f86ba36853fed381;hpb=0b90c5637dfea8a08f87db5dd16000eb679013a3;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 089fcb9..7ee8d85 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1353,6 +1353,13 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now) lockdep_assert_held(&iocg->waitq.lock); + /* + * If the delay is set by another CPU, we may be in the past. No need to + * change anything if so. This avoids decay calculation underflow. + */ + if (time_before64(now->now, iocg->delay_at)) + return false; + /* calculate the current delay in effect - 1/2 every second */ tdelta = now->now - iocg->delay_at; if (iocg->delay)