Skip to content

Commit

Permalink
[PATCH] highest_possible_node_id() linkage fix
Browse files Browse the repository at this point in the history
Qooting Adrian:

- net/sunrpc/svc.c uses highest_possible_node_id()

- include/linux/nodemask.h says highest_possible_node_id() is
  out-of-line #if MAX_NUMNODES > 1

- the out-of-line highest_possible_node_id() is in lib/cpumask.c

- lib/Makefile: lib-$(CONFIG_SMP) += cpumask.o
  CONFIG_ARCH_DISCONTIGMEM_ENABLE=y, CONFIG_SMP=n, CONFIG_SUNRPC=y

-> highest_possible_node_id() is used in net/sunrpc/svc.c
   CONFIG_NODES_SHIFT defined and > 0

-> include/linux/numa.h: MAX_NUMNODES > 1

-> compile error

The bug is not present on architectures where ARCH_DISCONTIGMEM_ENABLE
depends on NUMA (but m32r isn't the only affected architecture).

So move the function into page_alloc.c

Cc: Adrian Bunk <[email protected]>
Cc: Paul Jackson <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Oct 20, 2006
1 parent e51959f commit 6220ec7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/cpumask.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,3 @@ int __any_online_cpu(const cpumask_t *mask)
return cpu;
}
EXPORT_SYMBOL(__any_online_cpu);

#if MAX_NUMNODES > 1
/*
* Find the highest possible node id.
*/
int highest_possible_node_id(void)
{
unsigned int node;
unsigned int highest = 0;

for_each_node_mask(node, node_possible_map)
highest = node;
return highest;
}
EXPORT_SYMBOL(highest_possible_node_id);
#endif
16 changes: 16 additions & 0 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3120,3 +3120,19 @@ unsigned long page_to_pfn(struct page *page)
EXPORT_SYMBOL(pfn_to_page);
EXPORT_SYMBOL(page_to_pfn);
#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */

#if MAX_NUMNODES > 1
/*
* Find the highest possible node id.
*/
int highest_possible_node_id(void)
{
unsigned int node;
unsigned int highest = 0;

for_each_node_mask(node, node_possible_map)
highest = node;
return highest;
}
EXPORT_SYMBOL(highest_possible_node_id);
#endif

0 comments on commit 6220ec7

Please sign in to comment.