lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 May 2014 07:50:31 -0600
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Jiang Liu <jiang.liu@...ux.intel.com>
Cc:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Grant Likely <grant.likely@...aro.org>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Randy Dunlap <rdunlap@...radead.org>,
	Yinghai Lu <yinghai@...nel.org>,
	"x86@...nel.org" <x86@...nel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Tony Luck <tony.luck@...el.com>,
	Joerg Roedel <joro@...tes.org>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>
Subject: Re: [Patch V3 05/37] x86, PCI, ACPI: use kmalloc_node() to optimize
 for performance

On Tue, May 27, 2014 at 2:07 AM, Jiang Liu <jiang.liu@...ux.intel.com> wrote:
> Use kmalloc_node() instead of kmalloc() when possible to optimize
> for performance on NUMA platforms.
>
> Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>

Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>

I think this is micro-optimization, because I don't think these
structures are referenced often.  It might be nicer if we could
arrange to run this path on the local node, as we do in
pci_call_probe(), so all allocs would happen there.  But I'm OK with
this as-is.

> ---
>  arch/x86/pci/acpi.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 01edac6c5e18..91bef49df228 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -448,7 +448,7 @@ static void probe_pci_root_info(struct pci_root_info *info,
>                 return;
>
>         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) {
>                 info->res_num = 0;
>                 return;
> @@ -456,7 +456,7 @@ static void probe_pci_root_info(struct pci_root_info *info,
>
>         size = sizeof(*info->res_offset) * info->res_num;
>         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) {
>                 kfree(info->res);
>                 info->res = NULL;
> @@ -495,7 +495,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
>         if (node != NUMA_NO_NODE && !node_online(node))
>                 node = NUMA_NO_NODE;
>
> -       info = kzalloc(sizeof(*info), GFP_KERNEL);
> +       info = kzalloc_node(sizeof(*info), GFP_KERNEL, node);
>         if (!info) {
>                 printk(KERN_WARNING "pci_bus %04x:%02x: "
>                        "ignored (out of memory)\n", domain, busnum);
> --
> 1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ