Commit 827f02fe authored by Jack Steiner's avatar Jack Steiner Committed by Linus Torvalds

gru: initial GRU based on blade topology

Change the GRU initialization code to initialize based on blade topology
instead of node topology.  The result is the same but blade-based
initialization is cleaner.
Signed-off-by: default avatarJack Steiner <steiner@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 57e6d258
...@@ -264,11 +264,9 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr) ...@@ -264,11 +264,9 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
max_user_cbrs = GRU_NUM_CB; max_user_cbrs = GRU_NUM_CB;
max_user_dsr_bytes = GRU_NUM_DSR_BYTES; max_user_dsr_bytes = GRU_NUM_DSR_BYTES;
for_each_online_node(nid) { for_each_possible_blade(bid) {
bid = uv_node_to_blade_id(nid); pnode = uv_blade_to_pnode(bid);
pnode = uv_node_to_pnode(nid); nid = uv_blade_to_memory_nid(bid);
if (bid < 0 || gru_base[bid])
continue;
page = alloc_pages_exact_node(nid, GFP_KERNEL, order); page = alloc_pages_exact_node(nid, GFP_KERNEL, order);
if (!page) if (!page)
goto fail; goto fail;
...@@ -298,8 +296,8 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr) ...@@ -298,8 +296,8 @@ static int gru_init_tables(unsigned long gru_base_paddr, void *gru_base_vaddr)
return 0; return 0;
fail: fail:
for (nid--; nid >= 0; nid--) for (bid--; bid >= 0; bid--)
free_pages((unsigned long)gru_base[nid], order); free_pages((unsigned long)gru_base[bid], order);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment