Skip to content
Commit 13ab183d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

mm/kmemleak.c: make cond_resched() rate-limiting more efficient

Commit bde5f6bc ("kmemleak: add scheduling point to
kmemleak_scan()") tries to rate-limit the frequency of cond_resched()
calls, but does it in a way which might incur an expensive division
operation in the inner loop.  Simplify this.

Fixes: bde5f6bc

 ("kmemleak: add scheduling point to kmemleak_scan()")
Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 338f1d9d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment