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: 10407391 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 B46AF60155 for ; Thu, 17 May 2018 17:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2DEC28649 for ; Thu, 17 May 2018 17:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 966032864E; Thu, 17 May 2018 17:36:35 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D1CF2864A for ; Thu, 17 May 2018 17:36:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8827B6B0520; Thu, 17 May 2018 13:36:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 832A16B0521; Thu, 17 May 2018 13:36:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 721846B0522; Thu, 17 May 2018 13:36:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 3275C6B0520 for ; Thu, 17 May 2018 13:36:32 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id w7-v6so3102155pfd.9 for ; Thu, 17 May 2018 10:36:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:dkim-signature:dmarc-filter:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v1ZQopClSx1z/i4PIbsb5yyE9/T0AC/B3MPJo3lrQj8=; b=tNdSYbNJ4ZCemeMAJ5h2XTTKzsW5Y9RJ8xD+yFZUC0xqHBGnO+e2EoipN+KZWvN0+E p1zFZhRmKoHjJrUaIXJhS2GHYt5OpJH+EP2k4HZqHkXYQidgg8wVIFUq6VRFhZ0F+/9T pNBRv95b3p1tAa6rTDcxeZGXxzoX8jgbM3VBX9vGjJxcrIT4szI/ikiSpdLOxMCbddVj Yj+5th5VFpTbG+Jkv5/zz2SBE9x8J4UE+Zw1/m/OA/Y8JdhZkChiIozqqbSd44kfZi8w ltubKK/KVw69XYpgrtz6gf8wnNHV6R2fMyF5McsiBCZZ2wYq41dlDOYQ3tU01Oj8SEJj tHlw== X-Gm-Message-State: ALKqPwdmc9xGc+CPrs+clwxCgce5mnSHCKy8AKrKZ4FN9q7nE5L1mc21 NVfXosE4iO4PL6+WQ3MnvqIM+FAmcUYUDLQcYKZGE/uEoHzLWpeBVriuXhI1k6xSD+FEmzjGUNV SQ1yElYBaL4bhkLKyd68cXWamLHYmJcqCjUv6oTbWdj/zDMz1xTirXVl8L4P+UKfkbQ== X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr6019636pfo.199.1526578591820; Thu, 17 May 2018 10:36:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZollNfaQZJxCW0v4GSbg7fPAzg5o4+JZCGskBu0xX4PHm6QwKweRrhwCj8/pox98pKAHXw/ X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr6019621pfo.199.1526578591194; Thu, 17 May 2018 10:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526578591; cv=none; d=google.com; s=arc-20160816; b=gys0V6Wvqo+dZrv4tW9sp9H1hTB3A6NIX8iwVNEMGK8T+ZKnTtF2M14CM0UiGY2V9n YuAmsRghmXQ7qqLuATujkN+qO3IdDh/mNHfKnPNHKWvzQnM3/FS6DQO2sYYswrfQYDbd IC12r4wTjdHwcSCPUqAYK2yZv8sifasccJWNc6cTHsr9/kV77l/0QbRKnFk3ik8O1vMg WgzumXHgcio3A/F41O+R5K15+3uATOWcklrCFwg4KcWAteG37Zhc3mGrJhE/+XbFfbbI DuqiDOPhCQgdd4uqDqPHMbEpJZwJH1w/7zrkSLx4SRS1wZhjJaxFt/sJaG4P64Kc3TJi Ox7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=v1ZQopClSx1z/i4PIbsb5yyE9/T0AC/B3MPJo3lrQj8=; b=sYVJ6Nykt2r1tzvEXdrKunCKQ1xfEd5tYr7zDeI7re+FJbETD7utl+Efif48WANnLP Uf4ppGlI4OfJ37dxRQLEkjJ2YK0BfM8B/QwdIfx10dUXxxXW2DrE2furD3kPUjjYSiH5 gvDGhwxJbFaX9rqkost8bIGfJtLJ5Z2wdTrYB0K50c8fK53Ahh29v5GaIEbJJ/pWDOh9 0F2l7M5IJMlsTAqmKc++vs5qkTUjW/mA9vAM3VU+jJZuIvxByS77lS2k8Lh+oShxyaDc cRAAgLcMuW+LwtG98pm/Zs2WH+wWHCzBcoy0/hRBI7aSCGmBFV+bT57Odfgn6XMrhTer A5AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=jqMTf4d6; dkim=pass header.i=@codeaurora.org header.s=default header.b=jqMTf4d6; spf=pass (google.com: domain of okaya@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=okaya@codeaurora.org Received: from smtp.codeaurora.org (smtp.codeaurora.org. [198.145.29.96]) by mx.google.com with ESMTPS id 70-v6si5860450pfu.274.2018.05.17.10.36.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 10:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of okaya@codeaurora.org designates 198.145.29.96 as permitted sender) client-ip=198.145.29.96; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=jqMTf4d6; dkim=pass header.i=@codeaurora.org header.s=default header.b=jqMTf4d6; spf=pass (google.com: domain of okaya@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=okaya@codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B264F60D81; 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;