From patchwork Mon Mar 12 06:49:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 10275529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33F79602C2 for ; Mon, 12 Mar 2018 06:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21C8728AC7 for ; Mon, 12 Mar 2018 06:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1605E28BD5; Mon, 12 Mar 2018 06:50:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92FA828AC7 for ; Mon, 12 Mar 2018 06:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UWmUtnZy3kEh3gTfELRvtuFxnpsi+3+fkncpFazQ4u0=; b=VqZfQCOQCetHY4 Mofzw8n4C0RnC38WTXUtHX413hHFSs2cSihV9JkNUmScReBE1Sme+pN4/ybe/zR8cbQw8azaMnlB7 h/JbKqHrCbXuBiZVjE3PsFk5Jq12GgWrz9NezTP4mAh0ClHTEe0znkmlWDpuy2EucUiGzHtGP/zUI haA/w0C7CNZVimIgen6yGamnPJlPrw/dGnj2u9GkvX5yvWxs9AGYKXEnUW3Lirpjz8N1gc8KBQuJp 5I8JvP+K6ZI36iEckCwI1T+FNMeKLalWk4q0w8HXkm/WfQ9W6CjuwCPRjOtwbuhyX8xIme+BYelst f3tRKYt6XcGTmRjgYiLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1evHIE-0005T6-OA; Mon, 12 Mar 2018 06:50:46 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1evHIA-0005Qw-1C for linux-arm-kernel@lists.infradead.org; Mon, 12 Mar 2018 06:50:43 +0000 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1D5E5B77BC076; Mon, 12 Mar 2018 14:50:11 +0800 (CST) Received: from localhost (10.177.19.219) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Mon, 12 Mar 2018 14:50:05 +0800 From: Yang Yingliang To: 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 Message-ID: <1520837395-10288-3-git-send-email-yangyingliang@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1520837395-10288-1-git-send-email-yangyingliang@huawei.com> References: <1520837395-10288-1-git-send-email-yangyingliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180311_235042_299736_169687A5 X-CRM114-Status: UNSURE ( 8.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yangyingliang@huawei.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use alloc_pages_node() to allocate pages on current node. Signed-off-by: Yang Yingliang --- 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;