pci related patches 11-21-2009
please check several patches fromgit://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-2.6-yinghai.git for-pci
Thanks
YH
x86 related patches 11-21-2009
please check several patches fromgit://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-2.6-yinghai.git for-tip
YH
[tip:x86/apic] x86: apic: Remove not needed #ifdef
Commit-ID: e670761f12f4069d204f433bf547d9c679a4fd05 Gitweb: http://git.kernel.org/tip/e670761f12f4069d204f433bf547d9c679a4fd05 Author: Yinghai Lu <[email protected]> AuthorDate: Sat, 21 Nov 2009 00:23:37 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 23 Nov 2009 09:54:15 +0100
x86: apic: Remove not needed #ifdef
Suresh made dmar_table_init() already have that protection.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/apic.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
arch/x86/kernel/apic/apic.c +3 -6
@@ -1377,14 +1377,11 @@ void __init enable_IR_x2apic(void)unsigned long flags;struct IO_APIC_route_entry **ioapic_entries =NULL ;int ret, x2apic_enabled =0 ; -int dmar_table_init_ret =0 ; +int dmar_table_init_ret; -#ifdef CONFIG_INTR_REMAP dmar_table_init_ret =dmar_table_init (); -if (dmar_table_init_ret) -pr_debug ("dmar_table_init() failed with %d:\n" , - dmar_table_init_ret); -#endif +if (dmar_table_init_ret && !x2apic_supported ()) +return ; ioapic_entries =alloc_ioapic_entries ();if (!ioapic_entries) {
[tip:x86/apic] x86: Re-get cfg_new in case reuse/move irq_desc
In reply to Yinghai LuCommit-ID: 37ef2a3029fde884808ff1b369677abc7dd9a79a Gitweb: http://git.kernel.org/tip/37ef2a3029fde884808ff1b369677abc7dd9a79a Author: Yinghai Lu <[email protected]> AuthorDate: Sat, 21 Nov 2009 00:23:37 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 23 Nov 2009 09:56:05 +0100
x86: Re-get cfg_new in case reuse/move irq_desc
When irq_desc is moved, we need to make sure to use the right cfg_new.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/io_apic.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/apic/io_apic.c +1 -0
@@ -3186,6 +3186,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)continue ; desc_new =move_irq_desc (desc_new, node); + cfg_new = desc_new->chip_data;if (__assign_irq_vector (new, cfg_new, apic->target_cpus ()) ==0 ) irq = new;
[tip:x86/apic] x86: apic: Print out SRAT table APIC id in hex
In reply to Yinghai LuCommit-ID: 163d3866cfa79aa5945f1ee5e43fb3ed1455f75c Gitweb: http://git.kernel.org/tip/163d3866cfa79aa5945f1ee5e43fb3ed1455f75c Author: Yinghai Lu <[email protected]> AuthorDate: Sat, 21 Nov 2009 00:23:37 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 23 Nov 2009 09:56:30 +0100
x86: apic: Print out SRAT table APIC id in hex
Make it consistent with APIC MADT print out, for big systems APIC id in hex is more readable.
LKML-Reference: <[email protected]>
--- arch/x86/mm/srat_64.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/srat_64.c +2 -2
@@ -136,7 +136,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) apicid_to_node[apic_id] = node;node_set (node, cpu_nodes_parsed); acpi_numa =1 ; -printk (KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n" , +printk (KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n" , pxm, apic_id, node); }
@@ -170,7 +170,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) apicid_to_node[apic_id] = node;node_set (node, cpu_nodes_parsed); acpi_numa =1 ; -printk (KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n" , +printk (KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n" , pxm, apic_id, node); }
[tip:x86/mm] x86, numa, bootmem: Only free bootmem on NUMA failure path
In reply to Yinghai LuCommit-ID: 021428ad1418cf3c386a1a0157140c3ea29b17ef Gitweb: http://git.kernel.org/tip/021428ad1418cf3c386a1a0157140c3ea29b17ef Author: Yinghai Lu <[email protected]> AuthorDate: Sat, 21 Nov 2009 00:23:37 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 23 Nov 2009 10:00:48 +0100
x86, numa, bootmem: Only free bootmem on NUMA failure path
In the NUMA bootmem setup failure path we freed nodedata_phys incorrectly.
LKML-Reference: <[email protected]>
--- arch/x86/mm/numa_64.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
arch/x86/mm/numa_64.c +8 -2
@@ -239,8 +239,14 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) bootmap =early_node_mem (nodeid, bootmap_start, end, bootmap_pages<<PAGE_SHIFT ,PAGE_SIZE );if (bootmap ==NULL ) { -if (nodedata_phys < start || nodedata_phys >= end) -free_bootmem (nodedata_phys, pgdat_size); +if (nodedata_phys < start || nodedata_phys >= end) { +/* +* only need to free it if it is from other node +* bootmem +*/ +if (nid != nodeid) +free_bootmem (nodedata_phys, pgdat_size); + } node_data[nodeid] =NULL ;return ; }
[tip:x86/mm] x86, numa: Use near(er) online node instead of roundrobin for NUMA
In reply to Yinghai LuCommit-ID: d9c2d5ac6af87b4491bff107113aaf16f6c2b2d9 Gitweb: http://git.kernel.org/tip/d9c2d5ac6af87b4491bff107113aaf16f6c2b2d9 Author: Yinghai Lu <[email protected]> AuthorDate: Sat, 21 Nov 2009 00:23:37 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 23 Nov 2009 10:06:24 +0100
x86, numa: Use near(er) online node instead of roundrobin for NUMA
CPU to node mapping is set via the following sequence:
1. numa_init_array(): Set up roundrobin from cpu to online node
2. init_cpu_to_node(): Set that according to apicid_to_node[] according to srat only handle the node that is online, and leave other cpu on node without ram (aka not online) to still roundrobin.
3. later call srat_detect_node for Intel/AMD, will use first_online node or nearby node.
Problem is that setup_per_cpu_areas() is not called between 2 and 3, the per_cpu for cpu on node with ram is on different node, and could put that on node with two hops away.
So try to optimize this and add find_near_online_node() and call init_cpu_to_node().
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel.c | 6 +++++- arch/x86/mm/numa_64.c | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/intel.c +5 -1
@@ -263,8 +263,12 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)/* Don't do the funky fallback heuristics the AMD version employs for now. */ node = apicid_to_node[apicid]; -if (node ==NUMA_NO_NODE || !node_online (node)) +if (node ==NUMA_NO_NODE ) node =first_node (node_online_map); +else if (!node_online (node)) { +/* reuse the value from init_cpu_to_node() */ + node =cpu_to_node (cpu); + }numa_set_node (cpu, node);printk (KERN_INFO "CPU %d/0x%x -> Node %d\n" , cpu, apicid, node);
arch/x86/mm/numa_64.c +20 -1
@@ -764,6 +764,25 @@ static __init int numa_setup(char *opt)early_param ("numa" , numa_setup);#ifdef CONFIG_NUMA + +static __init int find_near_online_node (int node) +{ +int n, val; +int min_val =INT_MAX ; +int best_node =-1 ; + +for_each_online_node (n) { + val =node_distance (node, n); + +if (val < min_val) { + min_val = val; + best_node = n; + } + } + +return best_node; +} +/* * Setup early cpu_to_node. *
@@ -795,7 +814,7 @@ void __init init_cpu_to_node(void)if (node ==NUMA_NO_NODE )continue ;if (!node_online (node)) -continue ; + node =find_near_online_node (node);numa_set_node (cpu, node); } }
Quoted 6 lines · On Sat, 21 Nov 2009 00:35:36 -0800 Yinghai Lu <[email protected]> wrote:
please check several patches from
git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-2.6-yinghai.git
for-pci
The DMAR stuff can just go through the DMAR tree.
I don't see the two debug output patches on linux-pci, did you post them there?
I commented on one of the resource patches, I'll check the other two (long standing leaf release and pciehp) ones again; I mainly want a bunch of tested-bys for those.
The x86_pci_rootbus one looks ok I think, I'll see about applying that today.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 11 lines · Jesse Barnes
Quoted 6 lines · On Sat, 21 Nov 2009 00:35:36 -0800 Yinghai Lu <[email protected]> wrote:
please check several patches from
git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-2.6-yinghai.git
for-pciThe DMAR stuff can just go through the DMAR tree.
sent to David Woodhouse two times.
thinking you could pick up too. it is under drivers/pci ?
Quoted 3 lines
I don't see the two debug output patches on linux-pci, did you post them there?
will post them there.
Quoted 4 lines
I commented on one of the resource patches, I'll check the other two (long standing leaf release and pciehp) ones again; I mainly want a bunch of tested-bys for those.
thanks. thought will get one Reviewed-by and Tested-by from Kenji. still need to address bridges resource shrink hotplug bridges other than pcie. already sent him one add-on patch.
Quoted 3 lines
The
x86_pci_rootbusone looks ok I think, I'll see about applying that today.
Thanks
Yinghai
* Yinghai Lu <[email protected]>:
Quoted 9 lines
Quoted 4 lines · Jesse Barnes
I commented on one of the resource patches, I'll check the other two (long standing leaf release and pciehp) ones again; I mainly want a bunch of tested-bys for those.
thanks. thought will get one Reviewed-by and Tested-by from Kenji. still need to address bridges resource shrink hotplug bridges other than pcie. already sent him one add-on patch.
Sorry, I have been swamped lately with other things.
I will try and test Yinghai's patches this week.
/ac
x86 related patches 12-15-2009
In reply to Yinghai Luplease check several patches fromgit://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-2.6-yinghai.git for-tip
1a88d3a: x86: check range in update range
0fb059e: x86: move range related operation to one file
8a81618: x86: only call dma32_reserve_bootmem 64bit !CONFIG_NUMA 75d6a28: x86: make early_node_mem get mem > 4g if possible -v2 557bcb7: x86: print bootmem free before pci_iommu_alloc and free_all_bootmem 72fe68a: x86: dynamic increase early_res array size
de4546b: x86: introduce max_early_res and early_res_count 1caafab: x86: call early_res_to_bootmem one time
daefc77: x86: increase MAX_EARLY_RES
a9dc1ac: x86: fix checking of SRAT when node0 ram is not from 0 -v3
Thanks
Yinghai