mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <marc.zyngier@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <yangyingliang@huawei.com>
Subject: [RFC PATCH 2/4] irqchip/gic-v3-its: replace alloc_pages() with alloc_pages_node()
Date: Mon, 12 Mar 2018 14:49:53 +0800	[thread overview]
Message-ID: <1520837395-10288-3-git-send-email-yangyingliang@huawei.com> (raw)
In-Reply-To: <1520837395-10288-1-git-send-email-yangyingliang@huawei.com>

Use alloc_pages_node() to allocate pages on current node.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index a03e18e..4ebe131 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1557,11 +1557,11 @@ static void its_lpi_free_chunks(unsigned long *bitmap, int base, int nr_ids)
 	kfree(bitmap);
 }
 
-static struct page *its_allocate_prop_table(gfp_t gfp_flags)
+static struct page *its_allocate_prop_table(int nid, gfp_t gfp_flags)
 {
 	struct page *prop_page;
 
-	prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ));
+	prop_page = alloc_pages_node(nid, gfp_flags, get_order(LPI_PROPBASE_SZ));
 	if (!prop_page)
 		return NULL;
 
@@ -1587,7 +1587,8 @@ static int __init its_alloc_lpi_tables(void)
 	phys_addr_t paddr;
 
 	lpi_id_bits = min_t(u32, gic_rdists->id_bits, ITS_MAX_LPI_NRBITS);
-	gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT);
+	gic_rdists->prop_page = its_allocate_prop_table(cpu_to_node(smp_processor_id()),
+							GFP_NOWAIT);
 	if (!gic_rdists->prop_page) {
 		pr_err("Failed to allocate PROPBASE\n");
 		return -ENOMEM;
@@ -2829,7 +2830,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
 		return -ENOMEM;
 	}
 
-	vprop_page = its_allocate_prop_table(GFP_KERNEL);
+	vprop_page = its_allocate_prop_table(NUMA_NO_NODE, GFP_KERNEL);
 	if (!vprop_page) {
 		its_lpi_free_chunks(bitmap, base, nr_ids);
 		return -ENOMEM;
-- 
1.8.3

  parent reply	other threads:[~2018-03-12  6:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  6:49 [RFC PATCH 0/4] add support for CommonLPIAff field Yang Yingliang
2018-03-12  6:49 ` [RFC PATCH 1/4] irqchip/gic-v3: add common_aff_lpi field in struct rdists Yang Yingliang
2018-03-12  6:49 ` Yang Yingliang [this message]
2018-03-12  6:49 ` [RFC PATCH 3/4] irqchip/gic-v3-its: change prop_page to per-cpu type to support CommonLPIAff field Yang Yingliang
2018-03-12  6:49 ` [RFC PATCH 4/4] irqchip/gic-v3-its: sync config of LPIs if there are more than one prop_page Yang Yingliang
2018-03-12  9:55 ` [RFC PATCH 0/4] add support for CommonLPIAff field Marc Zyngier
2018-03-12 12:13   ` Yang Yingliang
2018-03-12 12:25     ` Marc Zyngier

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=1520837395-10288-3-git-send-email-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    /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

all inboxes | Powered by JetHome®