mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
53fee04f31
This patch resolves the issue of running with numa=fake=X on kernel command line on x86_64 machines that have big IO hole. While calculating the size of each node now we look at the total hole size in that range. Previously there were nodes that only had IO holes in them causing kernel boot problems. We now use the NODE_MIN_SIZE (64MB) as the minimum size of memory that any node must have. We reduce the number of allocated nodes if the number of nodes specified on kernel command line results in any node getting memory smaller than NODE_MIN_SIZE. This change allows the extra memory to be incremented in NODE_MIN_SIZE granule and uniformly distribute among as many nodes (called big nodes) as possible. [akpm@osdl.org: build fix] Signed-off-by: David Rientjes <reintjes@google.com> Signed-off-by: Paul Menage <menage@google.com> Signed-off-by: Rohit Seth <rohitseth@google.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
/* K8 NUMA support */
|
|
/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */
|
|
/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */
|
|
#ifndef _ASM_X86_64_MMZONE_H
|
|
#define _ASM_X86_64_MMZONE_H 1
|
|
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
#define VIRTUAL_BUG_ON(x)
|
|
|
|
#include <asm/smp.h>
|
|
|
|
/* Simple perfect hash to map physical addresses to node numbers */
|
|
struct memnode {
|
|
int shift;
|
|
unsigned int mapsize;
|
|
u8 *map;
|
|
u8 embedded_map[64-16];
|
|
} ____cacheline_aligned; /* total size = 64 bytes */
|
|
extern struct memnode memnode;
|
|
#define memnode_shift memnode.shift
|
|
#define memnodemap memnode.map
|
|
#define memnodemapsize memnode.mapsize
|
|
|
|
extern struct pglist_data *node_data[];
|
|
|
|
static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
|
|
{
|
|
unsigned nid;
|
|
VIRTUAL_BUG_ON(!memnodemap);
|
|
VIRTUAL_BUG_ON((addr >> memnode_shift) >= memnodemapsize);
|
|
nid = memnodemap[addr >> memnode_shift];
|
|
VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]);
|
|
return nid;
|
|
}
|
|
|
|
#define NODE_DATA(nid) (node_data[nid])
|
|
|
|
#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
|
|
#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
|
|
NODE_DATA(nid)->node_spanned_pages)
|
|
|
|
#ifdef CONFIG_DISCONTIGMEM
|
|
#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
|
|
|
|
extern int pfn_valid(unsigned long pfn);
|
|
#endif
|
|
|
|
#ifdef CONFIG_NUMA_EMU
|
|
#define FAKE_NODE_MIN_SIZE (64*1024*1024)
|
|
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1ul))
|
|
#endif
|
|
|
|
#endif
|
|
#endif
|