linux-stable/arch/x86/kernel/cpu/resctrl
Reinette Chatre e0ad6dc896 x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI
James reported in [1] that there could be two tasks running on the same CPU
with task_struct->on_cpu set. Using task_struct->on_cpu as a test if a task
is running on a CPU may thus match the old task for a CPU while the
scheduler is running and IPI it unnecessarily.

task_curr() is the correct helper to use. While doing so move the #ifdef
check of the CONFIG_SMP symbol to be a C conditional used to determine
if this helper should be used to ensure the code is always checked for
correctness by the compiler.

[1] https://lore.kernel.org/lkml/a782d2f3-d2f6-795f-f4b1-9462205fd581@arm.com

Reported-by: James Morse <james.morse@arm.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/e9e68ce1441a73401e08b641cc3b9a3cf13fe6d4.1608243147.git.reinette.chatre@intel.com
2021-01-11 11:34:45 +01:00
..
core.c - Add logic to correct MBM total and local values fixing errata SKX99 and BDF102 2020-12-14 13:53:17 -08:00
ctrlmondata.c x86/resctrl: Add struct rdt_cache::arch_has_{sparse, empty}_bitmaps 2020-08-19 10:41:40 +02:00
internal.h x86/resctrl: Add printf attribute to log function 2021-01-11 11:20:36 +01:00
Makefile x86/resctrl: Avoid confusion over the new X86_RESCTRL config 2019-02-02 10:34:52 +01:00
monitor.c - Add logic to correct MBM total and local values fixing errata SKX99 and BDF102 2020-12-14 13:53:17 -08:00
pseudo_lock.c mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio 2020-12-15 12:13:41 -08:00
pseudo_lock_event.h
rdtgroup.c x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI 2021-01-11 11:34:45 +01:00