lkml.org 
[lkml]   [2008]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 5/7] ide: NUMA aware allocation of host and port structures
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: NUMA aware allocation of host and port structures

kzalloc() -> kzalloc_node() in ide_host_alloc().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-probe.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1391,9 +1391,11 @@ static void ide_free_port_slot(int idx)
struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
{
struct ide_host *host;
+ struct device *dev = hws[0] ? hws[0]->dev : NULL;
+ int node = dev ? dev_to_node(dev) : -1;
int i;

- host = kzalloc(sizeof(*host), GFP_KERNEL);
+ host = kzalloc_node(sizeof(*host), GFP_KERNEL, node);
if (host == NULL)
return NULL;

@@ -1404,7 +1406,7 @@ struct ide_host *ide_host_alloc(const st
if (hws[i] == NULL)
continue;

- hwif = kzalloc(sizeof(*hwif), GFP_KERNEL);
+ hwif = kzalloc_node(sizeof(*hwif), GFP_KERNEL, node);
if (hwif == NULL)
continue;

@@ -1429,8 +1431,7 @@ struct ide_host *ide_host_alloc(const st
return NULL;
}

- if (hws[0])
- host->dev[0] = hws[0]->dev;
+ host->dev[0] = dev;

if (d) {
host->init_chipset = d->init_chipset;

\
 
 \ /
  Last update: 2008-12-21 22:05    [W:0.104 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site