From 42672d73de4fab730a2d6e91c92d19afebeb40bb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 9 Feb 2019 20:03:56 +0000 Subject: sys-kernel/linux-{image,sources}-redcore-lts : version bump to v4.14.95 && v4.19.20 --- ...e-calls-of-schedule_timeout-1-to-use-the-.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sys-kernel/linux-sources-redcore-lts/files/4.14-0005-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch (limited to 'sys-kernel/linux-sources-redcore-lts/files/4.14-0005-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch') diff --git a/sys-kernel/linux-sources-redcore-lts/files/4.14-0005-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch b/sys-kernel/linux-sources-redcore-lts/files/4.14-0005-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch new file mode 100644 index 00000000..3c889719 --- /dev/null +++ b/sys-kernel/linux-sources-redcore-lts/files/4.14-0005-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch @@ -0,0 +1,50 @@ +From 5da7d1778b96c514394334c92de9b3d8d71f4a29 Mon Sep 17 00:00:00 2001 +From: Con Kolivas +Date: Sat, 5 Nov 2016 09:27:36 +1100 +Subject: [PATCH 05/16] Special case calls of schedule_timeout(1) to use the + min hrtimeout of 1ms, working around low Hz resolutions. + +--- + kernel/time/timer.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 9c18e16059a3..dd4d1b193286 100644 +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -1741,6 +1741,19 @@ signed long __sched schedule_timeout(signed long timeout) + + expire = timeout + jiffies; + ++#ifdef CONFIG_HIGH_RES_TIMERS ++ if (timeout == 1 && hrtimer_resolution < NSEC_PER_SEC / HZ) { ++ /* ++ * Special case 1 as being a request for the minimum timeout ++ * and use highres timers to timeout after 1ms to workaround ++ * the granularity of low Hz tick timers. ++ */ ++ if (!schedule_min_hrtimeout()) ++ return 0; ++ goto out_timeout; ++ } ++#endif ++ + setup_timer_on_stack(&timer, process_timeout, (unsigned long)current); + __mod_timer(&timer, expire, false); + schedule(); +@@ -1748,10 +1761,10 @@ signed long __sched schedule_timeout(signed long timeout) + + /* Remove the timer from the object tracker */ + destroy_timer_on_stack(&timer); +- ++out_timeout: + timeout = expire - jiffies; + +- out: ++out: + return timeout < 0 ? 0 : timeout; + } + EXPORT_SYMBOL(schedule_timeout); +-- +2.11.0 + -- cgit v1.2.3