Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pdflush: use time_after() instead of open-coding it

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

OGAWA Hirofumi and committed by
Linus Torvalds
2b4bc460 b69c49b7

+2 -2
+2 -2
mm/pdflush.c
··· 130 130 * Thread creation: For how long have there been zero 131 131 * available threads? 132 132 */ 133 - if (jiffies - last_empty_jifs > 1 * HZ) { 133 + if (time_after(jiffies, last_empty_jifs + 1 * HZ)) { 134 134 /* unlocked list_empty() test is OK here */ 135 135 if (list_empty(&pdflush_list)) { 136 136 /* unlocked test is OK here */ ··· 151 151 if (nr_pdflush_threads <= MIN_PDFLUSH_THREADS) 152 152 continue; 153 153 pdf = list_entry(pdflush_list.prev, struct pdflush_work, list); 154 - if (jiffies - pdf->when_i_went_to_sleep > 1 * HZ) { 154 + if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) { 155 155 /* Limit exit rate */ 156 156 pdf->when_i_went_to_sleep = jiffies; 157 157 break; /* exeunt */