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: 10407409 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 7649A60247 for ; Thu, 17 May 2018 17:39:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BE3B2866B for ; Thu, 17 May 2018 17:39:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E43B2866D; Thu, 17 May 2018 17:39:39 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 D44F72866B for ; Thu, 17 May 2018 17:39:38 +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: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:In-Reply-To:References: List-Owner; bh=EJtDJlbdf2WrfnoNJX4ot4LLbTlZyezdRzi+UEPk2kw=; b=Q/KAfJ7K8zDlIh Kevj5GHhyjbRD1tYEuyawNtewd+q3KGRxYPxzZqgimyHtEP6WmUywC6Ui5103/yAw8NX9YE4DM9xE OvODX3fCDcKUG6DmpxOgCOa4nZaJpL/nvmbJkPP8P5v8yfMVt2LFkHCLPZPq6j/X/see1N1SOnVFE i3HJ68W850KI3IGhBD6zxwas5yEMyeyG4jqM9zVy4Hsl2buSGUzI3dQTbGZnCwRExNM0u2id7T9Fa CdWV+Vpe29SDMiHgdDTl4Y1ECFOdo5WYQ5MR6w8RIQIxrQkKJGbkgNjp0B3cJxH4JaBwsTpERQf3M ypyPleKAIOa916MF8+MQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJMsE-0007dV-Fl; Thu, 17 May 2018 17:39:30 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJMsC-0007cM-Fh for linux-arm-kernel@bombadil.infradead.org; Thu, 17 May 2018 17:39:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v1ZQopClSx1z/i4PIbsb5yyE9/T0AC/B3MPJo3lrQj8=; b=VgHIEw/L9rF82u+wpM4zlJXL7N e9DYFYU8T5JVduHBnVLp9p7TKnmAp7iSexVGjQyBZ05Qn1i1NmljHzTZtcUnRY278tg8PiBTt/4am isxlaPTBQYQY58y4r/xRnOqwniKa2djDPyqajH1hG7cju6q8fUtupxTfu258XX5RlR89UrZ6T0gkk fVH/jCPmofX0RuK/YdiB3upUnrXYrnjDd+w/lXra5xac/OCK77Noa0C4Fjt7Zqhng7Q25Ltbeqb5u ViRYO2jzo2F351vsRqZMUBY5kJcvuH/UQ/Pa1TeA6+Q2f+Dgo8gmlcfhB4teRaiAtBdbW1WorZmiE bq/33uWQ==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJMpY-0004Sm-Hi for linux-arm-kernel@lists.infradead.org; Thu, 17 May 2018 17:36:47 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 081F260F5F; 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=1526578591; bh=PGi+ZSksm3WdrlEmFTUP8EmHyqLUtpjrllfpH+9VVNc=; h=From:To:Cc:Subject:Date:From; b=aT6b9d4l5hwAgaFbnKpTOutlafM1kRiLjET5Z3zo9zsmnn52qLGZyJAKKIEIG4x1C 3gORSMR9iRn7BJ8EH+wxx7azlycnwQ+vRO9X9CafewJIcB1XNNVeBmRglWBvy31sq2 Wdy+7LEH9IUPpHAV6Xrd/1IGJOYThTyWdcYRqmdQ= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180517_183644_712038_294526DF X-CRM114-Status: GOOD ( 10.83 ) 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: Sinan Kaya , linux-arm-msm@vger.kernel.org, open list , linux-arm-kernel@lists.infradead.org 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 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;