From: Anna-Maria Behnsen Date: Mon, 14 Oct 2024 08:22:25 +0000 (+0200) Subject: mm/damon/core: Use generic upper bound recommondation for usleep_range() X-Git-Tag: v6.13-rc1~171^2~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef0245582e5bccd8b4c480a58bd4da91ee276397;p=thirdparty%2Fkernel%2Flinux.git mm/damon/core: Use generic upper bound recommondation for usleep_range() The upper bound for usleep_range_idle() was taken from the outdated documentation. As a recommondation for the upper bound of usleep_range() depends on HZ configuration it is not possible to hard code it. Use the define "USLEEP_RANGE_UPPER_BOUND" instead. Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Reviewed-by: SeongJae Park Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/all/20241014-devel-anna-maria-b4-timers-flseep-v3-8-dc8b907cb62f@linutronix.de --- diff --git a/mm/damon/core.c b/mm/damon/core.c index c725c78b43f01..79efd8089d6ca 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1892,8 +1892,7 @@ static unsigned long damos_wmark_wait_us(struct damos *scheme) static void kdamond_usleep(unsigned long usecs) { - /* See Documentation/timers/timers-howto.rst for the thresholds */ - if (usecs > 20 * USEC_PER_MSEC) + if (usecs >= USLEEP_RANGE_UPPER_BOUND) schedule_timeout_idle(usecs_to_jiffies(usecs)); else usleep_range_idle(usecs, usecs + 1);