page_alloc.c (cca448fe92246fb59efe55ba2e048ded0971a9af) page_alloc.c (6811378e7d8b9aa4fca2a1ca73d24c9d67c9cb12)
1/*
2 * linux/mm/page_alloc.c
3 *
4 * Manages the free list, the system allocates free pages here.
5 * Note that kmalloc() lives in slab.c
6 *
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 * Swap reorganised 29.12.95, Stephen Tweedie

--- 23 unchanged lines hidden (view full) ---

32#include <linux/topology.h>
33#include <linux/sysctl.h>
34#include <linux/cpu.h>
35#include <linux/cpuset.h>
36#include <linux/memory_hotplug.h>
37#include <linux/nodemask.h>
38#include <linux/vmalloc.h>
39#include <linux/mempolicy.h>
1/*
2 * linux/mm/page_alloc.c
3 *
4 * Manages the free list, the system allocates free pages here.
5 * Note that kmalloc() lives in slab.c
6 *
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 * Swap reorganised 29.12.95, Stephen Tweedie

--- 23 unchanged lines hidden (view full) ---

32#include <linux/topology.h>
33#include <linux/sysctl.h>
34#include <linux/cpu.h>
35#include <linux/cpuset.h>
36#include <linux/memory_hotplug.h>
37#include <linux/nodemask.h>
38#include <linux/vmalloc.h>
39#include <linux/mempolicy.h>
40#include <linux/stop_machine.h>
40
41#include <asm/tlbflush.h>
42#include <asm/div64.h>
43#include "internal.h"
44
45/*
46 * MCD - HACK: Find somewhere to initialize this EARLY, or make this
47 * initializer cleaner

--- 1651 unchanged lines hidden (view full) ---

1699 }
1700
1701 zonelist->zones[j] = NULL;
1702 }
1703}
1704
1705#endif /* CONFIG_NUMA */
1706
41
42#include <asm/tlbflush.h>
43#include <asm/div64.h>
44#include "internal.h"
45
46/*
47 * MCD - HACK: Find somewhere to initialize this EARLY, or make this
48 * initializer cleaner

--- 1651 unchanged lines hidden (view full) ---

1700 }
1701
1702 zonelist->zones[j] = NULL;
1703 }
1704}
1705
1706#endif /* CONFIG_NUMA */
1707
1707void __init build_all_zonelists(void)
1708/* return values int ....just for stop_machine_run() */
1709static int __meminit __build_all_zonelists(void *dummy)
1708{
1710{
1709 int i;
1711 int nid;
1712 for_each_online_node(nid)
1713 build_zonelists(NODE_DATA(nid));
1714 return 0;
1715}
1710
1716
1711 for_each_online_node(i)
1712 build_zonelists(NODE_DATA(i));
1717void __meminit build_all_zonelists(void)
1718{
1719 if (system_state == SYSTEM_BOOTING) {
1720 __build_all_zonelists(0);
1721 cpuset_init_current_mems_allowed();
1722 } else {
1723 /* we have to stop all cpus to guaranntee there is no user
1724 of zonelist */
1725 stop_machine_run(__build_all_zonelists, NULL, NR_CPUS);
1726 /* cpuset refresh routine should be here */
1727 }
1728
1713 printk("Built %i zonelists\n", num_online_nodes());
1729 printk("Built %i zonelists\n", num_online_nodes());
1714 cpuset_init_current_mems_allowed();
1730
1715}
1716
1717/*
1718 * Helper functions to size the waitqueue hash table.
1719 * Essentially these want to choose hash table sizes sufficiently
1720 * large so that collisions trying to wait on pages are rare.
1721 * But in fact, the number of active page waitqueues on typical
1722 * systems is ridiculously low, less than 200. So this is even

--- 1182 unchanged lines hidden ---
1731}
1732
1733/*
1734 * Helper functions to size the waitqueue hash table.
1735 * Essentially these want to choose hash table sizes sufficiently
1736 * large so that collisions trying to wait on pages are rare.
1737 * But in fact, the number of active page waitqueues on typical
1738 * systems is ridiculously low, less than 200. So this is even

--- 1182 unchanged lines hidden ---