Commit 965cd0e4 authored by Jiang Liu's avatar Jiang Liu Committed by Thomas Gleixner

x86, PCI, ACPI: Use kmalloc_node() to optimize for performance

Use kmalloc_node() instead of kmalloc() when possible to optimize
for performance on NUMA platforms.
Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1402302011-23642-6-git-send-email-jiang.liu@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 8d7cdcb9
...@@ -448,7 +448,7 @@ static void probe_pci_root_info(struct pci_root_info *info, ...@@ -448,7 +448,7 @@ static void probe_pci_root_info(struct pci_root_info *info,
return; return;
size = sizeof(*info->res) * info->res_num; size = sizeof(*info->res) * info->res_num;
info->res = kzalloc(size, GFP_KERNEL); info->res = kzalloc_node(size, GFP_KERNEL, info->sd.node);
if (!info->res) { if (!info->res) {
info->res_num = 0; info->res_num = 0;
return; return;
...@@ -456,7 +456,7 @@ static void probe_pci_root_info(struct pci_root_info *info, ...@@ -456,7 +456,7 @@ static void probe_pci_root_info(struct pci_root_info *info,
size = sizeof(*info->res_offset) * info->res_num; size = sizeof(*info->res_offset) * info->res_num;
info->res_num = 0; info->res_num = 0;
info->res_offset = kzalloc(size, GFP_KERNEL); info->res_offset = kzalloc_node(size, GFP_KERNEL, info->sd.node);
if (!info->res_offset) { if (!info->res_offset) {
kfree(info->res); kfree(info->res);
info->res = NULL; info->res = NULL;
...@@ -499,7 +499,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) ...@@ -499,7 +499,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
if (node != NUMA_NO_NODE && !node_online(node)) if (node != NUMA_NO_NODE && !node_online(node))
node = NUMA_NO_NODE; node = NUMA_NO_NODE;
info = kzalloc(sizeof(*info), GFP_KERNEL); info = kzalloc_node(sizeof(*info), GFP_KERNEL, node);
if (!info) { if (!info) {
printk(KERN_WARNING "pci_bus %04x:%02x: " printk(KERN_WARNING "pci_bus %04x:%02x: "
"ignored (out of memory)\n", domain, busnum); "ignored (out of memory)\n", domain, busnum);
......
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