Commit c72da22f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Clean up MAX_NR_NODES/NUMNODES/etc. [1/5]

From: Matthew Dobson <colpatch@us.ibm.com>

This starts a series of cleanups against the way in which the various
architectures specify the number of nodes and memory zones.  We end up
supporting up to 1024 memory zones on ia64, which is a recent requirement.

Has been tested on ia32, ia64 (UMA), ppa64 (UMA) and NUMAQ.


Make sure MAX_NUMNODES is defined in one and only one place.  Remove
superfluous definitions.  Instead of defining MAX_NUMNODES in
asm/numnodes.h, we define NODES_SHIFT there.  Then in linux/mmzone.h we
turn that NODES_SHIFT value into MAX_NUMNODES.
parent 96fcef0a
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#define MAX_NUMNODES 128 /* Marvel */
/* Max 128 Nodes - Marvel */
#define NODES_SHIFT 7
#endif /* _ASM_MAX_NUMNODES_H */
......@@ -28,7 +28,6 @@
#ifdef CONFIG_X86_NUMAQ
#define MAX_NUMNODES 16
extern int get_memcfg_numaq(void);
/*
......
......@@ -4,11 +4,15 @@
#include <linux/config.h>
#ifdef CONFIG_X86_NUMAQ
#include <asm/numaq.h>
#elif CONFIG_ACPI_SRAT
#include <asm/srat.h>
#else
#define MAX_NUMNODES 1
/* Max 16 Nodes */
#define NODES_SHIFT 4
#elif defined(CONFIG_ACPI_SRAT)
/* Max 8 Nodes */
#define NODES_SHIFT 3
#endif /* CONFIG_X86_NUMAQ */
#endif /* _ASM_MAX_NUMNODES_H */
......@@ -31,7 +31,6 @@
#error CONFIG_ACPI_SRAT not defined, and srat.h header has been included
#endif
#define MAX_NUMNODES 8
extern int get_memcfg_from_srat(void);
extern unsigned long *get_zholes_size(int);
......
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#define MAX_NUMNODES 16
/* Max 16 Nodes */
#define NODES_SHIFT 4
#endif /* _ASM_MAX_NUMNODES_H */
......@@ -10,7 +10,6 @@
#define VIRTUAL_BUG_ON(x)
#include <asm/numnodes.h>
#include <asm/smp.h>
#define MAXNODE 8
......
......@@ -3,10 +3,7 @@
#include <linux/config.h>
#ifdef CONFIG_DISCONTIGMEM
#define MAX_NUMNODES 8 /* APIC limit currently */
#else
#define MAX_NUMNODES 1
#endif
/* Max 8 Nodes - APIC limit currently */
#define NODES_SHIFT 3
#endif
......@@ -14,9 +14,10 @@
#ifdef CONFIG_DISCONTIGMEM
#include <asm/numnodes.h>
#endif
#ifndef MAX_NUMNODES
#define MAX_NUMNODES 1
#ifndef NODES_SHIFT
#define NODES_SHIFT 0
#endif
#define MAX_NUMNODES (1 << NODES_SHIFT)
/* Free memory management - zoned buddy allocator. */
#ifndef CONFIG_FORCE_MAX_ZONEORDER
......
......@@ -250,7 +250,7 @@ struct kmem_cache_s {
unsigned int limit;
/* 2) touched by every alloc & free from the backend */
struct kmem_list3 lists;
/* NUMA: kmem_3list_t *nodelists[NR_NODES] */
/* NUMA: kmem_3list_t *nodelists[MAX_NUMNODES] */
unsigned int objsize;
unsigned int flags; /* constant flags */
unsigned int num; /* # of objs per slab */
......
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