Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3558734imm; Thu, 17 May 2018 10:36:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpuKBYc+DoZWcgNMFXRZqT2e4BYWy6TW9pKhqk3SMUo3AvsZm71Y3hoTg633VnjbB7B2l+S X-Received: by 2002:a65:4acc:: with SMTP id c12-v6mr4671961pgu.329.1526578619351; Thu, 17 May 2018 10:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526578619; cv=none; d=google.com; s=arc-20160816; b=QVBnWF0nuC7hN/22lvCW0FYGm5VHZEiqyElDvPf7bp3LQhxd/wrjYLaBbTVUJNeBjk lX73h1WzDvwpqZc+rhYK6a9brjfy9fAj/9sjo3wEe6rVRJsToi2jJsIuM8crPmeA8+c6 2Y+Qt9cwN7PdLaNiWzD5bsEEYOfLuMDc7hNLAC/1AkJCE/ICYOXAuBhbkmzMJZF+WdDO ccDeKOOFrCQ9T59pUwMuW5Iu6PpgiyWFYSmkbsu+anm105KoD3UIMRFPhS4fhdKKl8z0 nwgynJ/TAtNp2ErXJJXBZTWst8p3tArLrpoZvWlHm4W6G857PB4U5DTPJ2+ZUEgwIXAX jx+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=rH8kO5gSsDR+IrR8HJzf4aM9QmVys/NstsnCvw44dyoiql/+to1WU2bVg7uKLSEknJ 8PDbH+QuSk9UCgv1PFFiKafDiLo3zGGEVzN3WepRrT+pYR0mpB3xW2FeOsmNa1/0pric 4x/hMpp/O4qNFa3a4pbF9mYhj4lDNc3DU11JRAzqvYknrLauEbDk8lrnmdAMpMExiXv6 GIXwCDRizznBqv/n0a/0AEdMODbF1Sr1rppfSd5DqqpGQSzsirmzkQPDudFLGFvpTAFj fsHhrslA8wNOW09MLRsQB0mfehh4XoHAELIsWkZ06VAShZpVJwW1aWj0oGs0NwdD1AOU T/yQ== 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: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si5533895plh.488.2018.05.17.10.36.44; Thu, 17 May 2018 10:36:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; 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: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbeEQRgc (ORCPT + 99 others); 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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.7.4