ascend inclusion category: Feature bugzilla: https://gitee.com/openeuler/kernel/issues/I7YF5R
---------------------------------------------
Return -ENOMEM when allocate hugepages failed.
Signed-off-by: Wang Wensheng wangwensheng4@huawei.com --- mm/share_pool.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/mm/share_pool.c b/mm/share_pool.c index 66f14fd38d25..1b9498fc0187 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -2064,6 +2064,8 @@ static int sp_alloc_populate(struct mm_struct *mm, struct sp_area *spa, * depends on this feature (and MAP_LOCKED) to work correctly. */ ret = do_mm_populate(mm, spa->va_start, populate, 0); + if (ac && (ac->sp_flags & SP_HUGEPAGE) && unlikely(ret == -EFAULT)) + ret = -ENOMEM; if (ret) { if (unlikely(fatal_signal_pending(current))) pr_warn("allocation failed, current thread is killed\n");