]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 13:19:23 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 13:19:23 +0000 (15:19 +0200)
added patches:
sched-fair-fix-vruntime_normalized-for-remote-non-migration-wakeup.patch
vmw_balloon-include-asm-io.h.patch

queue-4.18/sched-fair-fix-vruntime_normalized-for-remote-non-migration-wakeup.patch [new file with mode: 0644]
queue-4.18/series
queue-4.18/vmw_balloon-include-asm-io.h.patch [new file with mode: 0644]

diff --git a/queue-4.18/sched-fair-fix-vruntime_normalized-for-remote-non-migration-wakeup.patch b/queue-4.18/sched-fair-fix-vruntime_normalized-for-remote-non-migration-wakeup.patch
new file mode 100644 (file)
index 0000000..1b1c1fe
--- /dev/null
@@ -0,0 +1,68 @@
+From d0cdb3ce8834332d918fc9c8ff74f8a169ec9abe Mon Sep 17 00:00:00 2001
+From: Steve Muckle <smuckle@google.com>
+Date: Fri, 31 Aug 2018 15:42:17 -0700
+Subject: sched/fair: Fix vruntime_normalized() for remote non-migration wakeup
+
+From: Steve Muckle <smuckle@google.com>
+
+commit d0cdb3ce8834332d918fc9c8ff74f8a169ec9abe upstream.
+
+When a task which previously ran on a given CPU is remotely queued to
+wake up on that same CPU, there is a period where the task's state is
+TASK_WAKING and its vruntime is not normalized. This is not accounted
+for in vruntime_normalized() which will cause an error in the task's
+vruntime if it is switched from the fair class during this time.
+
+For example if it is boosted to RT priority via rt_mutex_setprio(),
+rq->min_vruntime will not be subtracted from the task's vruntime but
+it will be added again when the task returns to the fair class. The
+task's vruntime will have been erroneously doubled and the effective
+priority of the task will be reduced.
+
+Note this will also lead to inflation of all vruntimes since the doubled
+vruntime value will become the rq's min_vruntime when other tasks leave
+the rq. This leads to repeated doubling of the vruntime and priority
+penalty.
+
+Fix this by recognizing a WAKING task's vruntime as normalized only if
+sched_remote_wakeup is true. This indicates a migration, in which case
+the vruntime would have been normalized in migrate_task_rq_fair().
+
+Based on a similar patch from John Dias <joaodias@google.com>.
+
+Suggested-by: Peter Zijlstra <peterz@infradead.org>
+Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
+Signed-off-by: Steve Muckle <smuckle@google.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Chris Redpath <Chris.Redpath@arm.com>
+Cc: John Dias <joaodias@google.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Miguel de Dios <migueldedios@google.com>
+Cc: Morten Rasmussen <Morten.Rasmussen@arm.com>
+Cc: Patrick Bellasi <Patrick.Bellasi@arm.com>
+Cc: Paul Turner <pjt@google.com>
+Cc: Quentin Perret <quentin.perret@arm.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Todd Kjos <tkjos@google.com>
+Cc: kernel-team@android.com
+Fixes: b5179ac70de8 ("sched/fair: Prepare to fix fairness problems on migration")
+Link: http://lkml.kernel.org/r/20180831224217.169476-1-smuckle@google.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/fair.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/sched/fair.c
++++ b/kernel/sched/fair.c
+@@ -10019,7 +10019,8 @@ static inline bool vruntime_normalized(s
+        * - A task which has been woken up by try_to_wake_up() and
+        *   waiting for actually being woken up by sched_ttwu_pending().
+        */
+-      if (!se->sum_exec_runtime || p->state == TASK_WAKING)
++      if (!se->sum_exec_runtime ||
++          (p->state == TASK_WAKING && p->sched_remote_wakeup))
+               return true;
+       return false;
index 182185629bb901352fc89debff2f42bd9f0a99b8..357aa8b0a4ec6c1d376485c77ee4c51e9e94a7dc 100644 (file)
@@ -83,3 +83,5 @@ ext4-don-t-mark-mmp-buffer-head-dirty.patch
 ext4-show-test_dummy_encryption-mount-option-in-proc-mounts.patch
 ext4-dax-add-ext4_bmap-to-ext4_dax_aops.patch
 ext4-dax-set-ext4_dax_aops-for-dax-files.patch
+sched-fair-fix-vruntime_normalized-for-remote-non-migration-wakeup.patch
+vmw_balloon-include-asm-io.h.patch
diff --git a/queue-4.18/vmw_balloon-include-asm-io.h.patch b/queue-4.18/vmw_balloon-include-asm-io.h.patch
new file mode 100644 (file)
index 0000000..7f6bf44
--- /dev/null
@@ -0,0 +1,32 @@
+From a3b92ee6fc171d7c9d9b6b829b7fef169210440c Mon Sep 17 00:00:00 2001
+From: Nadav Amit <namit@vmware.com>
+Date: Thu, 13 Sep 2018 13:18:52 -0700
+Subject: vmw_balloon: include asm/io.h
+
+From: Nadav Amit <namit@vmware.com>
+
+commit a3b92ee6fc171d7c9d9b6b829b7fef169210440c upstream.
+
+Fix a build error due to missing virt_to_phys()
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Fixes: f0a1bf29d821b ("vmw_balloon: fix inflation with batching")
+Cc: stable@vger.kernel.org
+Cc: Xavier Deguillard <xdeguillard@vmware.com>
+Signed-off-by: Nadav Amit <namit@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/vmw_balloon.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/misc/vmw_balloon.c
++++ b/drivers/misc/vmw_balloon.c
+@@ -45,6 +45,7 @@
+ #include <linux/seq_file.h>
+ #include <linux/vmw_vmci_defs.h>
+ #include <linux/vmw_vmci_api.h>
++#include <linux/io.h>
+ #include <asm/hypervisor.h>
+ MODULE_AUTHOR("VMware, Inc.");