From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] ide: NUMA aware allocation of host and port structures
Date: Sun, 21 Dec 2008 22:00:35 +0100 [thread overview]
Message-ID: <20081221210035.23795.39294.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20081221210007.23795.27999.sendpatchset@localhost.localdomain>
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;
next prev parent reply other threads:[~2008-12-21 21:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-21 21:00 [PATCH 1/7] amd74xx: use ide_get_pair_dev() helper Bartlomiej Zolnierkiewicz
2008-12-21 21:00 ` [PATCH 2/7] cmd640: " Bartlomiej Zolnierkiewicz
2008-12-22 10:08 ` Sergei Shtylyov
2008-12-21 21:00 ` [PATCH 3/7] cmd64x: " Bartlomiej Zolnierkiewicz
2008-12-22 10:07 ` Sergei Shtylyov
2008-12-21 21:00 ` [PATCH 4/7] it821x: " Bartlomiej Zolnierkiewicz
2008-12-22 10:11 ` Sergei Shtylyov
2008-12-21 21:00 ` Bartlomiej Zolnierkiewicz [this message]
2008-12-21 21:00 ` [PATCH 6/7] ide: dynamic allocation of device structures Bartlomiej Zolnierkiewicz
2008-12-21 21:00 ` [PATCH 7/7] ide: add port and host iterators Bartlomiej Zolnierkiewicz
2008-12-22 10:09 ` [PATCH 1/7] amd74xx: use ide_get_pair_dev() helper Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081221210035.23795.39294.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).