x86/resctrl: Don't move a task to the same resource group
Fenghua Yu authored
commit a0195f31 upstream

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/

Backporting notes:

Since upstream commit fa7d9493 ("x86/resctrl: Rename and move rdt
files to a separate directory"), the file
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c has been renamed and moved to
arch/x86/kernel/cpu/resctrl/rdtgroup.c.
Apply the change against file arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
for older stable trees.

Fixes: e02737d5

 ("x86/intel_rdt: Add tasks files")
Reported-by: default avatarShakeel Butt <shakeelb@google.com>
Signed-...
aa9a5d96
Name Last commit Last update
Documentation USB: UAS: introduce a quirk to set no_write_same
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text
arch x86/resctrl: Don't move a task to the same resource group
block block: factor out requeue handling from dispatch code
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
crypto crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
drivers chtls: Fix chtls resources release sequence
firmware Fix built-in early-load Intel microcode alignment
fs btrfs: send: fix wrong file path when there is an inode with a pending rmdir
include net: sched: prevent invalid Scell_log shift count
init printk: reduce LOG_BUF_SHIFT range for H8300
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
kernel workqueue: Kick a worker based on the actual activation of delayed works
lib lib/genalloc: fix the overflow when size is too big
mm mm/swapfile: do not sleep with a spin lock held
net net: ipv6: fib: flush exceptions when purging route
samples samples: bpf: Fix lwt_len_hist reusing previous BPF map
scripts depmod: handle the case of /sbin/depmod without /sbin in PATH
security ima: Don't modify file descriptor mode on the fly
sound ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
tools perf record: Fix memory leak when using '--user-regs=?' to list registers
usr initramfs: restore default compression behavior
virt KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace
.clang-format clang-format: Set IndentWrappedFunctionNames false
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.