From patchwork Thu May 17 17:36:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10407389 X-Patchwork-Delegate: agross@codeaurora.org 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 3B59860353 for ; Thu, 17 May 2018 17:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2919D28649 for ; Thu, 17 May 2018 17:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DBBA28662; Thu, 17 May 2018 17:36:34 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB6C28649 for ; Thu, 17 May 2018 17:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750924AbeEQRgc (ORCPT ); Thu, 17 May 2018 13:36:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52578 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbeEQRgb (ORCPT ); Thu, 17 May 2018 13:36:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C4E1E609D1; Thu, 17 May 2018 17:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526578590; bh=PGi+ZSksm3WdrlEmFTUP8EmHyqLUtpjrllfpH+9VVNc=; h=From:To:Cc:Subject:Date:From; b=jqMTf4d6YHpKDbncycEUUxIfaLbXOJuJma0Hct2bO/bpr71wyOyV9Dsk5S5ukDQGt NMhH8bBpHn76YF0kAB6E+vSoRLHVQZDkuD5+Ri7OW5vKaXEBFDGcXQeBf9NdcxU524 6DHhqGE3KlmzfRR/if9ga8kRMZKrVGoGX6Zb2xns= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BB17660881; Thu, 17 May 2018 17:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526578590; bh=PGi+ZSksm3WdrlEmFTUP8EmHyqLUtpjrllfpH+9VVNc=; h=From:To:Cc:Subject:Date:From; b=jqMTf4d6YHpKDbncycEUUxIfaLbXOJuJma0Hct2bO/bpr71wyOyV9Dsk5S5ukDQGt NMhH8bBpHn76YF0kAB6E+vSoRLHVQZDkuD5+Ri7OW5vKaXEBFDGcXQeBf9NdcxU524 6DHhqGE3KlmzfRR/if9ga8kRMZKrVGoGX6Zb2xns= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BB17660881 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-mm@kvack.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] mm/dmapool: localize page allocations Date: Thu, 17 May 2018 13:36:19 -0400 Message-Id: <1526578581-7658-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Try to keep the pool closer to the device's NUMA node by changing kmalloc() to kmalloc_node() and devres_alloc() to devres_alloc_node(). Signed-off-by: Sinan Kaya --- mm/dmapool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index 4d90a64..023f3d9 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c @@ -223,7 +223,7 @@ static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags) { struct dma_page *page; - page = kmalloc(sizeof(*page), mem_flags); + page = kmalloc_node(sizeof(*page), mem_flags, dev_to_node(pool->dev)); if (!page) return NULL; page->vaddr = dma_alloc_coherent(pool->dev, pool->allocation, @@ -504,7 +504,8 @@ struct dma_pool *dmam_pool_create(const char *name, struct device *dev, { struct dma_pool **ptr, *pool; - ptr = devres_alloc(dmam_pool_release, sizeof(*ptr), GFP_KERNEL); + ptr = devres_alloc_node(dmam_pool_release, sizeof(*ptr), GFP_KERNEL, + dev_to_node(dev)); if (!ptr) return NULL;