linux/kernel/time
SeongJae Park a9ec7ed936 BACKPORT: timers: implement usleep_idle_range()
Patch series "mm/damon: Fix fake /proc/loadavg reports", v3.

This patchset fixes DAMON's fake load report issue.  The first patch
makes yet another variant of usleep_range() for this fix, and the second
patch fixes the issue of DAMON by making it using the newly introduced
function.

This patch (of 2):

Some kernel threads such as DAMON could need to repeatedly sleep in
micro seconds level.  Because usleep_range() sleeps in uninterruptible
state, however, such threads would make /proc/loadavg reports fake load.

To help such cases, this commit implements a variant of usleep_range()
called usleep_idle_range().  It is same to usleep_range() but sets the
state of the current task as TASK_IDLE while sleeping.

Link: https://lkml.kernel.org/r/20211126145015.15862-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20211126145015.15862-2-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: John Stultz <john.stultz@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit e4779015fd)

Bug: 228223814
Signed-off-by: Hailong Tu <tuhailong@oppo.com>
Change-Id: Ie590ba5fcff22c981d0a7ecae6d8e551160136f3
2022-04-28 23:09:17 +08:00
..
alarmtimer.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-25 09:04:16 +01:00
clockevents.c
clocksource.c Revert "clocksource: Reduce clocksource-skew threshold" 2022-02-01 10:11:25 +01:00
hrtimer.c hrtimer: Ensure timerfd notification for HIGHRES=n 2021-09-15 09:50:25 +02:00
itimer.c time: Prevent undefined behaviour in timespec64_to_ns() 2020-10-26 11:48:11 +01:00
jiffies.c Revert "clocksource: Reduce clocksource-skew threshold" 2022-02-01 10:11:25 +01:00
Kconfig posix-cpu-timers: Provide mechanisms to defer timer handling to task_work 2020-08-06 16:50:59 +02:00
Makefile
namespace.c
ntp_internal.h
ntp.c
posix-clock.c
posix-cpu-timers.c posix-cpu-timers: Clear task::posix_cputimers_work in copy_process() 2021-11-18 14:04:29 +01:00
posix-stubs.c
posix-timers.c posix-timers: Preserve return value in clock_adjtime32() 2021-05-11 14:47:16 +02:00
posix-timers.h
sched_clock.c ANDROID: GKI: Export sched_clock_register 2021-12-07 00:47:04 +00:00
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c FROMGIT: timer_list: Print name of per-cpu wakeup device 2021-06-04 18:33:43 +01:00
tick-common.c FROMGIT: tick/broadcast: Prefer per-cpu oneshot wakeup timers to broadcast 2021-06-04 18:33:43 +01:00
tick-internal.h This is the 5.10.65 stable release 2021-09-15 14:16:47 +02:00
tick-oneshot.c
tick-sched.c ANDROID: sched: time: Export symbols needed for schedutil module 2021-02-22 11:58:23 -08:00
tick-sched.h
time.c ANDROID: GKI: time: Export for nsec_to_clock_t 2020-08-12 15:10:04 +00:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c
timekeeping_internal.h timekeeping/vsyscall: Provide vdso_update_begin/end() 2020-08-06 10:57:30 +02:00
timekeeping.c timekeeping: Really make sure wall_to_monotonic isn't positive 2021-12-22 09:30:58 +01:00
timekeeping.h
timer_list.c FROMGIT: timer_list: Print name of per-cpu wakeup device 2021-06-04 18:33:43 +01:00
timer.c BACKPORT: timers: implement usleep_idle_range() 2022-04-28 23:09:17 +08:00
vsyscall.c timekeeping/vsyscall: Provide vdso_update_begin/end() 2020-08-06 10:57:30 +02:00