]> git.baikalelectronics.ru Git - kernel.git/commit
x86/resctrl: Don't move a task to the same resource group
authorFenghua Yu <fenghua.yu@intel.com>
Thu, 17 Dec 2020 22:31:19 +0000 (14:31 -0800)
committerBorislav Petkov <bp@suse.de>
Fri, 8 Jan 2021 08:08:03 +0000 (09:08 +0100)
commitb932abe00cffc31ba8eb25254b22d6a26a5b8079
tree64fa158d93d3c5b1ccf2ff5d59a5327155a9a8fc
parent77af8707fbad38cfe8afd58253729e7830ece3aa
x86/resctrl: Don't move a task to the same resource group

Shakeel Butt reported in [1] that a user can request a task to be moved
to a resource group even if the task is already in the group. It just
wastes time to do the move operation which could be costly to send IPI
to a different CPU.

Add a sanity check to ensure that the move operation only happens when
the task is not already in the resource group.

[1] https://lore.kernel.org/lkml/CALvZod7E9zzHwenzf7objzGKsdBmVwTgEJ0nPgs0LUFU3SN5Pw@mail.gmail.com/

Fixes: fe55f63dff87 ("x86/intel_rdt: Add tasks files")
Reported-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/962ede65d8e95be793cb61102cca37f7bb018e66.1608243147.git.reinette.chatre@intel.com
arch/x86/kernel/cpu/resctrl/rdtgroup.c