Commit 281b97e7 authored by Yu Liao's avatar Yu Liao
Browse files

arm64/mpam: change allocation mode from GFP_KERNEL to GFP_NOWAIT

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9RXHK



--------------------------------

We observed the following stack:
 #0 [ffff80054c9e3af0] __switch_to at ffffa05c1ad69fbc
 #1 [ffff80054c9e3b40] __schedule at ffffa05c1baf4014
 #2 [ffff80054c9e3ba0] __cond_resched at ffffa05c1baf4a70
 #3 [ffff80054c9e3bc0] kmem_cache_alloc_trace at ffffa05c1b130584
 #4 [ffff80054c9e3c20] __resctrl_group_move_task at ffffa05c1ad9a674
 #5 [ffff80054c9e3c70] resctrl_group_rmid_write at ffffa05c1ad9bc40
 #6 [ffff80054c9e3cd0] resctrl_group_file_write at ffffa05c1ad986e4

__resctrl_group_move_task() is called by resctrl_group_rmid_write()
in atomic context where sleep is prohibited.

Ensure calling context won't sleep by changing allocation mode from
GFP_KERNEL to GFP_NOWAIT.

Fixes: e37caef1 ("resctrlfs: mpam: Build basic framework for mpam")
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
parent 7b683423
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1365,7 +1365,7 @@ int __resctrl_group_move_task(struct task_struct *tsk,
	struct task_move_callback *callback;
	int ret;

	callback = kzalloc(sizeof(*callback), GFP_KERNEL);
	callback = kzalloc(sizeof(*callback), GFP_NOWAIT);
	if (!callback)
		return -ENOMEM;
	callback->work.func = move_myself;