linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH 02/21] ppc/eeh: use slab to allocate eeh devices
Date: Wed,  5 Sep 2012 14:14:37 +0800	[thread overview]
Message-ID: <1346825696-13960-3-git-send-email-shangw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1346825696-13960-1-git-send-email-shangw@linux.vnet.ibm.com>

The EEH initialization functions have been postponed until slab/slub
are ready. So we use slab/slub to allocate the memory chunks for
newly creatd EEH devices. That would save lots of memory.

The patch also does cleanup to replace "kmalloc" with "kzalloc" so
that we needn't clear the allocated memory chunk explicitly.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/eeh_cache.c |    2 +-
 arch/powerpc/platforms/pseries/eeh_dev.c   |    2 +-
 arch/powerpc/platforms/pseries/eeh_event.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c
index e5ae1c6..f50b717 100644
--- a/arch/powerpc/platforms/pseries/eeh_cache.c
+++ b/arch/powerpc/platforms/pseries/eeh_cache.c
@@ -151,7 +151,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
 			return piar;
 		}
 	}
-	piar = kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
+	piar = kzalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
 	if (!piar)
 		return NULL;
 
diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c
index ab68c59..8e3443b 100644
--- a/arch/powerpc/platforms/pseries/eeh_dev.c
+++ b/arch/powerpc/platforms/pseries/eeh_dev.c
@@ -55,7 +55,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data)
 	struct eeh_dev *edev;
 
 	/* Allocate EEH device */
-	edev = zalloc_maybe_bootmem(sizeof(*edev), GFP_KERNEL);
+	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
 	if (!edev) {
 		pr_warning("%s: out of memory\n", __func__);
 		return NULL;
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index fb50631..6132772 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -139,7 +139,7 @@ int eeh_send_failure_event(struct eeh_dev *edev)
 		printk(KERN_ERR "EEH: PCI location = %s\n", location);
 		return 1;
 	}
-	event = kmalloc(sizeof(*event), GFP_ATOMIC);
+	event = kzalloc(sizeof(*event), GFP_ATOMIC);
 	if (event == NULL) {
 		printk(KERN_ERR "EEH: out of memory, event not handled\n");
 		return 1;
-- 
1.7.5.4

  parent reply	other threads:[~2012-09-05  6:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  6:14 [PATCH 00/21 V3] powerpc/eeh: PE support Gavin Shan
2012-09-05  6:14 ` [PATCH 01/21] ppc/eeh: move EEH initialization around Gavin Shan
2012-09-05  6:14 ` Gavin Shan [this message]
2012-09-05  6:14 ` [PATCH 03/21] ppc/eeh: more logs for EEH initialization Gavin Shan
2012-09-05  6:14 ` [PATCH 04/21] ppc/eeh: Introduce eeh_pe struct Gavin Shan
2012-09-05  6:14 ` [PATCH 05/21] ppc/eeh: introduce global mutex Gavin Shan
2012-09-05  6:14 ` [PATCH 06/21] ppc/eeh: Create PEs for PHBs Gavin Shan
2012-09-05  6:14 ` [PATCH 07/21] ppc/eeh: Search PE based on requirement Gavin Shan
2012-09-05  6:14 ` [PATCH 08/21] ppc/eeh: create PEs duing EEH initialization Gavin Shan
2012-09-05  6:14 ` [PATCH 09/21] ppc/eeh: remove PE at appropriate time Gavin Shan
2012-09-05  6:14 ` [PATCH 10/21] ppc/eeh: build EEH event based on PE Gavin Shan
2012-09-05  6:14 ` [PATCH 11/21] ppc/eeh: trace EEH state " Gavin Shan
2012-09-05  6:14 ` [PATCH 12/21] ppc/eeh: trace error based on PE from beginning Gavin Shan
2012-09-05  6:14 ` [PATCH 13/21] ppc/eeh: eeh options based on PE Gavin Shan
2012-09-05  6:14 ` [PATCH 14/21] ppc/eeh: device bars restore " Gavin Shan
2012-09-05  6:14 ` [PATCH 15/21] ppc/eeh: I/O enable and log retrival " Gavin Shan
2012-09-05  6:14 ` [PATCH 16/21] ppc/eeh: do reset " Gavin Shan
2012-09-05  6:14 ` [PATCH 17/21] ppc/eeh: make EEH handler PE sensitive Gavin Shan
2012-09-05  6:14 ` [PATCH 18/21] ppc/eeh: handle EEH error based on PE Gavin Shan
2012-09-05  6:14 ` [PATCH 19/21] ppc/eeh: move stats to PE Gavin Shan
2012-09-05  6:14 ` [PATCH 20/21] ppc/eeh: probe mode support Gavin Shan
2012-09-05  6:14 ` [PATCH 21/21] ppc/eeh: trace eeh device from I/O cache Gavin Shan
  -- strict thread matches above, loose matches on Subject: below --
2012-06-27 16:01 [PATCH V2 00/16] powerpc/eeh: PE support Gavin Shan
2012-06-27 16:01 ` [PATCH 02/21] ppc/eeh: use slab to allocate eeh devices Gavin Shan

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=1346825696-13960-3-git-send-email-shangw@linux.vnet.ibm.com \
    --to=shangw@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.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).