BACKPORT: mm/damon/core: use better timer mechanisms selection threshold
Patch series "mm/damon: Trivial fixups and improvements". This patchset contains trivial fixups and improvements for DAMON and its kunit/kselftest tests. This patch (of 11): DAMON is using hrtimer if requested sleep time is <=100ms, while the suggested threshold[1] is <=20ms. This commit applies the threshold. [1] Documentation/timers/timers-howto.rst Link: https://lkml.kernel.org/r/20211201150440.1088-2-sj@kernel.org Fixes: ee801b7dd7822 ("mm/damon/schemes: activate schemes based on a watermarks mechanism") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit 4de46a30b9929d3d1b29e481d48e9c25f8ac7919) Bug: 228223814 Signed-off-by: zhijun wan <wanzhijun@oppo.com> Change-Id: Ieb5e3e196c96d8d54c83fecec53fdd13db763b62
This commit is contained in:
committed by
Suren Baghdasaryan
parent
d49b62ccfd
commit
e5a2bdfb0a
@@ -457,7 +457,7 @@ int damon_start(struct damon_ctx **ctxs, int nr_ctxs)
|
|||||||
static void kdamond_usleep(unsigned long usecs)
|
static void kdamond_usleep(unsigned long usecs)
|
||||||
{
|
{
|
||||||
/* See Documentation/timers/timers-howto.rst for the thresholds */
|
/* See Documentation/timers/timers-howto.rst for the thresholds */
|
||||||
if (usecs > 20 * 1000)
|
if (usecs > 20 * USEC_PER_MSEC)
|
||||||
schedule_timeout_idle(usecs_to_jiffies(usecs));
|
schedule_timeout_idle(usecs_to_jiffies(usecs));
|
||||||
else
|
else
|
||||||
usleep_idle_range(usecs, usecs + 1);
|
usleep_idle_range(usecs, usecs + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user