From: Greg Kroah-Hartman Date: Tue, 10 Jul 2018 16:54:48 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v3.18.115~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cc3029a10aa931ca18a9c3845b08c747e2f9d45;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: revert-mm-vmstat.c-fix-vmstat_update-preemption-bug.patch --- diff --git a/queue-4.14/revert-mm-vmstat.c-fix-vmstat_update-preemption-bug.patch b/queue-4.14/revert-mm-vmstat.c-fix-vmstat_update-preemption-bug.patch new file mode 100644 index 00000000000..e438614f710 --- /dev/null +++ b/queue-4.14/revert-mm-vmstat.c-fix-vmstat_update-preemption-bug.patch @@ -0,0 +1,60 @@ +From 28557cc106e6d2aa8b8c5c7687ea9f8055ff3911 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 27 Jun 2018 23:26:05 -0700 +Subject: Revert mm/vmstat.c: fix vmstat_update() preemption BUG + +From: Sebastian Andrzej Siewior + +commit 28557cc106e6d2aa8b8c5c7687ea9f8055ff3911 upstream. + +Revert commit c7f26ccfb2c3 ("mm/vmstat.c: fix vmstat_update() preemption +BUG"). Steven saw a "using smp_processor_id() in preemptible" message +and added a preempt_disable() section around it to keep it quiet. This +is not the right thing to do it does not fix the real problem. + +vmstat_update() is invoked by a kworker on a specific CPU. This worker +it bound to this CPU. The name of the worker was "kworker/1:1" so it +should have been a worker which was bound to CPU1. A worker which can +run on any CPU would have a `u' before the first digit. + +smp_processor_id() can be used in a preempt-enabled region as long as +the task is bound to a single CPU which is the case here. If it could +run on an arbitrary CPU then this is the problem we have an should seek +to resolve. + +Not only this smp_processor_id() must not be migrated to another CPU but +also refresh_cpu_vm_stats() which might access wrong per-CPU variables. +Not to mention that other code relies on the fact that such a worker +runs on one specific CPU only. + +Therefore revert that commit and we should look instead what broke the +affinity mask of the kworker. + +Link: http://lkml.kernel.org/r/20180504104451.20278-1-bigeasy@linutronix.de +Signed-off-by: Sebastian Andrzej Siewior +Cc: Steven J. Hill +Cc: Tejun Heo +Cc: Vlastimil Babka +Cc: Thomas Gleixner +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/vmstat.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -1770,11 +1770,9 @@ static void vmstat_update(struct work_st + * to occur in the future. Keep on running the + * update worker thread. + */ +- preempt_disable(); + queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, + this_cpu_ptr(&vmstat_work), + round_jiffies_relative(sysctl_stat_interval)); +- preempt_enable(); + } + } + diff --git a/queue-4.14/series b/queue-4.14/series index 645c964f2b7..844d05ac155 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -50,3 +50,4 @@ mtd-cfi_cmdset_0002-change-erase-functions-to-check-chip-good-only.patch netfilter-nf_log-don-t-hold-nf_log_mutex-during-user-access.patch staging-comedi-quatech_daqp_cs-fix-no-op-loop-daqp_ao_insn_write.patch sched-tracing-fix-trace_sched_pi_setprio-for-deboosting.patch +revert-mm-vmstat.c-fix-vmstat_update-preemption-bug.patch