1. 08 Jul, 2008 11 commits
    • Thomas Gleixner's avatar
      x86: numa_64.c make local variables static · 864fc31e
      Thomas Gleixner authored
      plat_node_bdata, cmdline, nodemap_addr, nodemap_size are local to
      numa_64.c. Make them static
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      864fc31e
    • Jeremy Fitzhardinge's avatar
      x86: compile error fix for smpboot.c · f307d25e
      Jeremy Fitzhardinge authored
      Without this patch, my link fails with:
      
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3c6e): In function `get_local_pda':
      : undefined reference to `_cpu_pda'
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3cd1): In function `get_local_pda':
      : undefined reference to `after_bootmem'
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3cec): In function `get_local_pda':
      : undefined reference to `_cpu_pda'
      make[2]: *** [.tmp_vmlinux1] Error 1
      
      Caused by commit 766da892634694f795b18b9538407816896fc470
          x86: remove static boot_cpu_pda array v2
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      f307d25e
    • Mike Travis's avatar
      x86: leave initial __cpu_pda array in place until cpus are booted · 5deb0b2a
      Mike Travis authored
      Ingo Molnar wrote:
      ...
      > they crashed after about 3 randconfig iterations with:
      >
      >   early res: 4 [8000-afff] PGTABLE
      >   early res: 5 [b000-b87f] MEMNODEMAP
      > PANIC: early exception 0e rip 10:ffffffff8077a150 error 2 cr2 37
      > Pid: 0, comm: swapper Not tainted 2.6.25-sched-devel.git-x86-latest.git #14
      >
      > Call Trace:
      >  [<ffffffff81466196>] early_idt_handler+0x56/0x6a
      >  [<ffffffff8077a150>] ? numa_set_node+0x30/0x60
      >  [<ffffffff8077a129>] ? numa_set_node+0x9/0x60
      >  [<ffffffff8147a543>] numa_init_array+0x93/0xf0
      >  [<ffffffff8147b039>] acpi_scan_nodes+0x3b9/0x3f0
      >  [<ffffffff8147a496>] numa_initmem_init+0x136/0x150
      >  [<ffffffff8146da5f>] setup_arch+0x48f/0x700
      >  [<ffffffff802566ea>] ? clockevents_register_notifier+0x3a/0x50
      >  [<ffffffff81466a87>] start_kernel+0xd7/0x440
      >  [<ffffffff81466422>] x86_64_start_kernel+0x222/0x280
      ...
      Here's the fixup...  This one should follow the previous patches.
      
      Thanks,
      Mike
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      5deb0b2a
    • Mike Travis's avatar
      x86: remove static boot_cpu_pda array v2 · 3461b0af
      Mike Travis authored
        * Remove the boot_cpu_pda array and pointer table from the data section.
          Allocate the pointer table and array during init.  do_boot_cpu()
          will reallocate the pda in node local memory and if the cpu is being
          brought up before the bootmem array is released (after_bootmem = 0),
          then it will free the initial pda.  This will happen for all cpus
          present at system startup.
      
          This removes 512k + 32k bytes from the data section.
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      3461b0af
    • Mike Travis's avatar
      x86: remove the static 256k node_to_cpumask_map · 9f248bde
      Mike Travis authored
        * Consolidate node_to_cpumask operations and remove the 256k
          byte node_to_cpumask_map.  This is done by allocating the
          node_to_cpumask_map array after the number of possible nodes
          (nr_node_ids) is known.
      
        * Debug printouts when CONFIG_DEBUG_PER_CPU_MAPS is active have
          been increased.  It now shows faults when calling node_to_cpumask()
          and node_to_cpumask_ptr().
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      9f248bde
    • Mike Travis's avatar
      x86: restore pda nodenumber field · 7891a24e
      Mike Travis authored
        * Restore the nodenumber field in the x86_64 pda.  This field is slightly
          different than the x86_cpu_to_node_map mainly because it's a static
          indication of which node the cpu is on while the cpu to node map is a
          dyanamic mapping that may get reset if the cpu goes offline.  This also
          simplifies the numa_node_id() macro.
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      7891a24e
    • Mike Travis's avatar
      x86: cleanup early per cpu variables/accesses v4 · 23ca4bba
      Mike Travis authored
        * Introduce a new PER_CPU macro called "EARLY_PER_CPU".  This is
          used by some per_cpu variables that are initialized and accessed
          before there are per_cpu areas allocated.
      
          ["Early" in respect to per_cpu variables is "earlier than the per_cpu
          areas have been setup".]
      
          This patchset adds these new macros:
      
      	DEFINE_EARLY_PER_CPU(_type, _name, _initvalue)
      	EXPORT_EARLY_PER_CPU_SYMBOL(_name)
      	DECLARE_EARLY_PER_CPU(_type, _name)
      
      	early_per_cpu_ptr(_name)
      	early_per_cpu_map(_name, _idx)
      	early_per_cpu(_name, _cpu)
      
          The DEFINE macro defines the per_cpu variable as well as the early
          map and pointer.  It also initializes the per_cpu variable and map
          elements to "_initvalue".  The early_* macros provide access to
          the initial map (usually setup during system init) and the early
          pointer.  This pointer is initialized to point to the early map
          but is then NULL'ed when the actual per_cpu areas are setup.  After
          that the per_cpu variable is the correct access to the variable.
      
          The early_per_cpu() macro is not very efficient but does show how to
          access the variable if you have a function that can be called both
          "early" and "late".  It tests the early ptr to be NULL, and if not
          then it's still valid.  Otherwise, the per_cpu variable is used
          instead:
      
      	#define early_per_cpu(_name, _cpu) 			\
      		(early_per_cpu_ptr(_name) ?			\
      			early_per_cpu_ptr(_name)[_cpu] :	\
      			per_cpu(_name, _cpu))
      
          A better method is to actually check the pointer manually.  In the
          case below, numa_set_node can be called both "early" and "late":
      
      	void __cpuinit numa_set_node(int cpu, int node)
      	{
      	    int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);
      
      	    if (cpu_to_node_map)
      		    cpu_to_node_map[cpu] = node;
      	    else
      		    per_cpu(x86_cpu_to_node_map, cpu) = node;
      	}
      
        * Add a flag "arch_provides_topology_pointers" that indicates pointers
          to topology cpumask_t maps are available.  Otherwise, use the function
          returning the cpumask_t value.  This is useful if cpumask_t set size
          is very large to avoid copying data on to/off of the stack.
      
        * The coverage of CONFIG_DEBUG_PER_CPU_MAPS has been increased while
          the non-debug case has been optimized a bit.
      
        * Remove an unreferenced compiler warning in drivers/base/topology.c
      
        * Clean up #ifdef in setup.c
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      23ca4bba
    • Mike Travis's avatar
      x86: modify Kconfig to allow up to 4096 cpus · 1184dc2f
      Mike Travis authored
        * Increase the limit of NR_CPUS to 4096 and introduce a boolean
          called "MAXSMP" which when set (e.g. "allyesconfig"), will set
          NR_CPUS = 4096 and NODES_SHIFT = 9 (512).
      
        * Changed max setting for NODES_SHIFT from 15 to 9 to accurately
          reflect the real limit.
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      1184dc2f
    • Mike Travis's avatar
      x86: fix remove cpu_pda table patch · 7496b606
      Mike Travis authored
      Mike Travis wrote:
      > Ingo Molnar wrote:
      >> * Mike Travis <travis@sgi.com> wrote:
      >>
      >>> [Ingo - please replace "PATCH 07/11" with this one.]
      
      > >>>     *	Remove 544k bytes from the kernel by removing the boot_cpu_pda
      > >>> 	array from the data section and allocating it during startup.
      
      >>> 	Fixed panic in setup_per_cpu_areas when HOTPLUG_CPU not set.
      >>>
      >>> For inclusion into sched-devel/latest tree.
      >> sched-devel.git randconfig testing found another crash with your queue:
      >>
      >> [    0.111060] Brought up 1 CPUs
      >> [    0.111986] Total of 1 processors activated (4022.73 BogoMIPS).
      >> [    0.112987] Testing NMI watchdog ... <1>BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
      >> [    0.114982] IP: [<ffffffff8180d4a0>] check_nmi_watchdog+0xb0/0x210
      >> [    0.114982] PGD 0
      >> [    0.114982] Oops: 0000 [1] SMP
      >> [    0.114982] CPU 0
      >> [............]
      >>
      >>  http://redhat.com/~mingo/misc/config-Mon_Apr_28_23_25_25_CEST_2008.bad
      >>  http://redhat.com/~mingo/misc/log-Mon_Apr_28_23_25_25_CEST_2008.bad
      >>
      >> 	Ingo
      >
      > Hi Ingo,
      >
      > I need a bit more information on your hardware configuration.  Building a
      > kernel with the above config file started up fine on both the Intel and AMD
      > boxes.
      >
      > Based on the above output it looks like it might be a UP machine?
      ...
      
      Ok, I think I found it.  In check_nmi_watchdog():
      
              for (cpu = 0; cpu < NR_CPUS; cpu++)
                      prev_nmi_count[cpu] = cpu_pda(cpu)->__nmi_count;
      
      As I mentioned it works fine on both of my systems so could you try it out?
      
      Thanks!
      Mike
      --
      
        * Change function check_nmi_watchdog() to use nr_cpu_ids instead of NR_CPUS.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      7496b606
    • Yinghai Lu's avatar
      x86: don't call pxm_to_node again · dbb6152e
      Yinghai Lu authored
      also make bus_numa work even if ACPI_NUMA is not defined.
      
      don't call pxm_to_node again, and use node directly.
      Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      dbb6152e
    • Yinghai Lu's avatar
      x86: make dev_to_node return online node · b755de8d
      Yinghai Lu authored
      a numa system (with multi HT chains) may return node without ram. Aka it
      is not online. Try to get an online node, otherwise return -1.
      Signed-off-by: default avatarYinghai Lu <yinghai.lu@sun.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      b755de8d
  2. 06 Jul, 2008 5 commits
  3. 05 Jul, 2008 15 commits
  4. 04 Jul, 2008 9 commits