mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
f2fs: fix timeout precision of f2fs_io_schedule_timeout_killable()
Sometimes, f2fs_io_schedule_timeout_killable(HZ) may delay for about 2 seconds, this is because __f2fs_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT) may delay for about 2 * DEFAULT_SCHEDULE_TIMEOUT due to its precision, but we only account the delay as DEFAULT_SCHEDULE_TIMEOUT as below, fix it. f2fs_io_schedule_timeout_killable() .. timeout -= DEFAULT_SCHEDULE_TIMEOUT; Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
da90b67155
commit
6fa1160539
|
|
@ -4985,13 +4985,12 @@ static inline void __f2fs_schedule_timeout(long timeout, bool io)
|
|||
|
||||
static inline void f2fs_io_schedule_timeout_killable(long timeout)
|
||||
{
|
||||
while (timeout) {
|
||||
unsigned long last_time = jiffies + timeout;
|
||||
|
||||
while (jiffies < last_time) {
|
||||
if (fatal_signal_pending(current))
|
||||
return;
|
||||
__f2fs_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT, true);
|
||||
if (timeout <= DEFAULT_SCHEDULE_TIMEOUT)
|
||||
return;
|
||||
timeout -= DEFAULT_SCHEDULE_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user