Contributors: 16
Author Tokens Token Proportion Commits Commit Proportion
Dan J Williams 59 25.11% 5 17.86%
Mike Rapoport 39 16.60% 3 10.71%
Yasunori Goto 24 10.21% 2 7.14%
Andrew Morton 22 9.36% 4 14.29%
Yury Norov 17 7.23% 1 3.57%
Andi Kleen 17 7.23% 2 7.14%
Alison Schofield 13 5.53% 1 3.57%
Dave Hansen 12 5.11% 1 3.57%
Jarkko Sakkinen 11 4.68% 1 3.57%
Wen Congyang 8 3.40% 2 7.14%
Kent Overstreet 5 2.13% 1 3.57%
Tony Breeds 3 1.28% 1 3.57%
Paul Mackerras 2 0.85% 1 3.57%
Greg Kroah-Hartman 1 0.43% 1 3.57%
Mike Travis 1 0.43% 1 3.57%
Robert Richter 1 0.43% 1 3.57%
Total 235 28


/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_NUMA_H
#define _LINUX_NUMA_H
#include <linux/init.h>
#include <linux/types.h>

#ifdef CONFIG_NODES_SHIFT
#define NODES_SHIFT     CONFIG_NODES_SHIFT
#else
#define NODES_SHIFT     0
#endif

#define MAX_NUMNODES    (1 << NODES_SHIFT)

#define	NUMA_NO_NODE	(-1)
#define	NUMA_NO_MEMBLK	(-1)

static inline bool numa_valid_node(int nid)
{
	return nid >= 0 && nid < MAX_NUMNODES;
}

/* optionally keep NUMA memory info available post init */
#ifdef CONFIG_NUMA_KEEP_MEMINFO
#define __initdata_or_meminfo
#else
#define __initdata_or_meminfo __initdata
#endif

#ifdef CONFIG_NUMA
#include <asm/sparsemem.h>

extern struct pglist_data *node_data[];
#define NODE_DATA(nid)	(node_data[nid])

void __init alloc_node_data(int nid);
void __init alloc_offline_node_data(int nid);

/* Generic implementation available */
int numa_nearest_node(int node, unsigned int state);

#ifndef memory_add_physaddr_to_nid
int memory_add_physaddr_to_nid(u64 start);
#endif

#ifndef phys_to_target_node
int phys_to_target_node(u64 start);
#endif

int numa_fill_memblks(u64 start, u64 end);

#else /* !CONFIG_NUMA */
static inline int numa_nearest_node(int node, unsigned int state)
{
	return NUMA_NO_NODE;
}

static inline int memory_add_physaddr_to_nid(u64 start)
{
	return 0;
}
static inline int phys_to_target_node(u64 start)
{
	return 0;
}

static inline void alloc_offline_node_data(int nid) {}
#endif

#define numa_map_to_online_node(node) numa_nearest_node(node, N_ONLINE)

#ifdef CONFIG_HAVE_ARCH_NODE_DEV_GROUP
extern const struct attribute_group arch_node_dev_group;
#endif

#endif /* _LINUX_NUMA_H */