提交 b9b3aaad 编写于 作者: M Ma Wupeng 提交者: Wang Wensheng

mm: Update reliable flag in memory allocaion for reliable task only in task context

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S
CVE: NA

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

Since interrupt may occupy reliable task's context and its current->flags
will have PF_RELIABLE and this will lead to redirect it's memory allocation
to mirrored region.

In order to solve this problem, update reliable task's gfp flag can only
happen in normal task context by checking in_task().
Signed-off-by: NMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
上级 d81e9624
......@@ -5186,6 +5186,9 @@ static inline void prepare_before_alloc(gfp_t *gfp_mask)
if (!zone_movable)
goto clear_flag;
if (!in_task())
return;
if ((current->flags & PF_RELIABLE) || is_global_init(current))
*gfp_mask |= GFP_RELIABLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册