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: e37caef15c18 ("resctrlfs: mpam: Build basic framework for mpam") Signed-off-by: Yu Liao liaoyu15@huawei.com --- arch/arm64/kernel/mpam/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/mpam/mpam_resctrl.c b/arch/arm64/kernel/mpam/mpam_resctrl.c index 544468c4177a..dfbf1e056cc0 100644 --- a/arch/arm64/kernel/mpam/mpam_resctrl.c +++ b/arch/arm64/kernel/mpam/mpam_resctrl.c @@ -1401,7 +1401,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;