* Jesse Barnes wrote: > The current mp_bus_to_node array is initialized only by AMD specific > code, since AMD platforms have registers that can be used for > determining mode numbers. On new Intel platforms it's necessary to > initialize this array as well though, otherwise all PCI node numbers > will be 0, when in fact they should be -1 (indicating that I/O isn't > tied to any particular node). > > So move the mp_bus_to_node code into the common PCI code, and > initialize it early with a default value of -1. This may be overridden > later by arch code (e.g. the AMD code). > > With this change, PCI consistent memory and other node specific > allocations (e.g. skbuff allocs) should occur on the "current" node. > If, for performance reasons, applications want to be bound to specific > nodes, they should open their devices only after being pinned to the > CPU where they'll run, for maximum locality. > > Any thoughts here Yinghai or Jesse? > > > include/asm/pci.h | 2 + > kernel/setup.c | 2 + > pci/amd_bus.c | 61 +----------------------------------------- > pci/common.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 83 insertions(+), 59 deletions(-) FYI, this commit: acccaba: x86/PCI: initialize PCI bus node numbers early caused a boot crash in -tip testing: calling amd_init+0x0/0x16 @ 1 pata_amd 0000:00:06.0: version 0.4.1 pata_amd 0000:00:06.0: setting latency timer to 64 BUG: unable to handle kernel NULL pointer dereference at 00000e44 IP: [] __alloc_pages_nodemask+0x44/0x4e0 *pdpt = 00000000024e8001 *pde = 0000000000000000 Oops: 0000 [#1] PREEMPT SMP last sysfs file: kthreadd_task: f68a8440 Pid: 1, comm: swapper Not tainted (2.6.31-rc2-00263-gacccaba-dirty #9102) System Product Name EIP: 0060:[] EFLAGS: 00010246 CPU: 0 EIP is at __alloc_pages_nodemask+0x44/0x4e0 EAX: 00000000 EBX: 000080d0 ECX: 00000e40 EDX: 00000e40 ESI: f5ff923c EDI: 003fffff EBP: f689ed9c ESP: f689ed44 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Process swapper (pid: 1, ti=f689e000 task=f68a8000 task.ti=f689e000) Stack: 00331788 00000e40 00000000 f72c1f20 00000000 c1582968 f689ed88 c10dc4a9 <0> 00000001 ffffffff 000000d0 c2421788 f5832940 f689ed98 00000000 c2421788 <0> 00000202 f689edbc c10dda24 000000ff f5ff923c 000080d0 f689edcc c102707b Call Trace: [] ? dmam_alloc_coherent+0x28/0x120 [] ? __slab_alloc+0x449/0x4d0 [] ? __kmalloc_track_caller+0xc4/0x190 [] ? dma_generic_alloc_coherent+0x9b/0x160 [] ? dma_generic_alloc_coherent+0x0/0x160 [] ? dmam_alloc_coherent+0xe5/0x120 [] ? ata_port_start+0x23/0x40 [] ? ata_sff_port_start+0x14/0x30 [] ? ata_host_start+0xf5/0x1d0 [] ? ata_pci_sff_activate_host+0x2a/0x1d0 [] ? ata_sff_interrupt+0x0/0xe0 [] ? ata_pci_sff_init_one+0xe2/0x110 [] ? amd_init_one+0xc0/0x1d0 [] ? local_pci_probe+0x13/0x20 [] ? pci_device_probe+0x81/0xd0 [] ? driver_probe_device+0x84/0x240 [] ? __driver_attach+0x79/0x80 [] ? bus_for_each_dev+0x50/0x90 [] ? driver_attach+0x19/0x20 [] ? __driver_attach+0x0/0x80 [] ? bus_add_driver+0x217/0x330 [] ? pci_device_remove+0x0/0x40 [] ? pci_device_probe+0x0/0xd0 [] ? driver_register+0x77/0x170 [] ? amd_init+0x0/0x16 [] ? amd_init+0x0/0x16 [] ? __pci_register_driver+0x3a/0xa0 [] ? amd_init+0x0/0x16 [] ? amd_init+0x14/0x16 [] ? do_one_initcall+0x29/0x130 [] ? init_irq_proc+0x65/0x80 [] ? kernel_init+0x11e/0x176 [] ? kernel_init+0x0/0x176 [] ? kernel_thread_helper+0x7/0x10 Code: 08 00 3d 08 00 08 00 0f 84 da 00 00 00 8b 3d c0 36 42 c2 85 ff 0f 84 8c 00 00 00 c7 45 b8 00 00 00 00 8b 3d b4 36 42 c2 8b 55 ac <8b> 72 04 85 f6 0f 84 a1 00 00 00 89 d9 83 e1 0f 01 c9 be 21 01 EIP: [] __alloc_pages_nodemask+0x44/0x4e0 SS:ESP 0068:f689ed44 CR2: 0000000000000e44 ---[ end trace bdfad5a2d2b496c5 ]--- via the x86/mrst topic tree. Config attached. Ingo