Skip to content

Commit

Permalink
hugetlb_cgroup: use helper macro NUMA_NO_NODE
Browse files Browse the repository at this point in the history
It's better to use NUMA_NO_NODE instead of magic number -1. Minor
readability improvement.

Link: https://lkml.kernel.org/r/20220729080106.12752-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Miaohe Lin authored and Andrew Morton committed Sep 12, 2022
1 parent 736a8cc commit 9924938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/hugetlb_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ hugetlb_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
* function.
*/
for_each_node(node) {
/* Set node_to_alloc to -1 for offline nodes. */
/* Set node_to_alloc to NUMA_NO_NODE for offline nodes. */
int node_to_alloc =
node_state(node, N_NORMAL_MEMORY) ? node : -1;
node_state(node, N_NORMAL_MEMORY) ? node : NUMA_NO_NODE;
h_cgroup->nodeinfo[node] =
kzalloc_node(sizeof(struct hugetlb_cgroup_per_node),
GFP_KERNEL, node_to_alloc);
Expand Down

0 comments on commit 9924938

Please sign in to comment.