aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/resctrl/monitor.c
diff options
context:
space:
mode:
authorXiaochen Shen <xiaochen.shen@intel.com>2020-01-09 00:13:46 +0800
committerBorislav Petkov <bp@suse.de>2020-01-13 14:10:21 +0100
commitdc433797c6f639e46824585bbf943578f13d54bf (patch)
tree5ddd9ea8026bfac1bfba437197c71b632d987506 /arch/x86/kernel/cpu/resctrl/monitor.c
parentLinux 5.5-rc6 (diff)
downloadlinux-dev-dc433797c6f639e46824585bbf943578f13d54bf.tar.xz
linux-dev-dc433797c6f639e46824585bbf943578f13d54bf.zip
x86/resctrl: Do not reconfigure exiting tasks
When writing a pid to file "tasks", a callback function move_myself() is queued to this task to be called when the task returns from kernel mode or exits. The purpose of move_myself() is to activate the newly assigned closid and/or rmid associated with this task. This activation is done by calling resctrl_sched_in() from move_myself(), the same function that is called when switching to this task. If this work is successfully queued but then the task enters PF_EXITING status (e.g., receiving signal SIGKILL, SIGTERM) prior to the execution of the callback move_myself(), move_myself() still calls resctrl_sched_in() since the task status is not currently considered. When a task is exiting, the data structure of the task itself will be freed soon. Calling resctrl_sched_in() to write the register that controls the task's resources is unnecessary and it implies extra performance overhead. Add check on task status in move_myself() and return immediately if the task is PF_EXITING. [ bp: Massage. ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lkml.kernel.org/r/1578500026-21152-1-git-send-email-xiaochen.shen@intel.com
Diffstat (limited to 'arch/x86/kernel/cpu/resctrl/monitor.c')
0 files changed, 0 insertions, 0 deletions