[PATCH OLK-6.6] mm/numa_remote: fix wild-memory-access in numa_remote_hugetlb_nowatermark
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDB01L ---------------------------------------- NUMA_NO_NODE will be passed to numa_remote_hugetlb_nowatermark() if we echo xx > /proc/sys/vm/nr_hugepages. When hugetlb_nowatermark is enabled, numa_remote_hugetlb_nowatermark() will trigger wild-memory-access. To fix it, check nid whether is NUMA_NO_NODE before calling numa_remote_hugetlb_nowatermark(). Fixes: 3a1587ef612c ("mm/numa_remote: introduce hugetlb_nowatermark mode for remote node") Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com> --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b00dda9db0c9..1a98b599c0b0 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3944,7 +3944,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, /* yield cpu to avoid soft lockup */ cond_resched(); - if (numa_remote_hugetlb_nowatermark(nid) && !drained && (nid != NUMA_NO_NODE)) { + if ((nid != NUMA_NO_NODE) && numa_remote_hugetlb_nowatermark(nid) && !drained) { hugetlb_drain_remote_pcp(h, nid); drained = true; } -- 2.43.0
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/19526 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/GIB... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/19526 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/GIB...
participants (2)
-
Jinjiang Tu -
patchwork bot