Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3750083imm; Thu, 17 May 2018 14:07:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzILt5q4qGKzXYdUnIp9ShrVSakCliyg/Co4oO8eBJ+2tpVp2RRtaS/9NkPZUiLTsMJPO7 X-Received: by 2002:a62:c103:: with SMTP id i3-v6mr6585491pfg.148.1526591264242; Thu, 17 May 2018 14:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526591264; cv=none; d=google.com; s=arc-20160816; b=y41ytWb+VAY+FPlOPbGsHn+BQY1/bX0fiRK9WCzuueiWacoKnL+2N40Sq9UOmr2zNC IYundjMzlVDtlfOvedLNsHf31t8xC2NW3ruIKzLHpluQTErs0tfEoCvuIYbhkGAbWyp5 DVW+ONNNBJzRNfLzlYqF1113mPvZkqt0BwX7tEH99RDb6LhCiqJBND6pEyn0dHI8fFIg ZJ1HCdYtBj9W0tom9KcTek8nQmulclmXd1jywUFom/UBVlifq5FZZk/45/y9uG4X5jN5 UIbcqofSbzVP/6tIdCa2tAKtOwDUepCH41ppF/5lUDPn4H8vLJmnzfkyM7AB+31lcnrq H/DQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=gqrlx2yE20i/Rs0KdKjrWKf2qO8yTlHhbp7dRETyHcU=; b=XG+CmkUDkozBm9Osu39el2RV7NJoIKUxPy2aY/nXH1vg9cMIm3rNUClu12p7H9MHMa cffiqEH5HNtjcRciebdqm9NihaLa58cN7rz1arJ8eZamKtw3QX8ad2W4uqVL3q24Es8c rhZsKCZxkZ+Ak5GjaqF7/GzPlgQbxRPv5jdzIX0oABQbTBAgEi7yr4vkBOin/I660Y6H ke4Jtq8xVF6qidgjNPvDb/zDsAIZcoj9lM5g8802vUqeTbhIQJ/busFcR/M7sG1xPq2H d4+78uBM0a4FyV4+Sq0W1NnMO++A9s4nYDWq0XGf1+UT0apGsWSwCfpkwfFZ4VzGZ9QZ ZgmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VLmVIunB; dkim=pass header.i=@codeaurora.org header.s=default header.b=KTDeLIHZ; 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 7-v6si5869957plc.179.2018.05.17.14.07.29; Thu, 17 May 2018 14:07:44 -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=VLmVIunB; dkim=pass header.i=@codeaurora.org header.s=default header.b=KTDeLIHZ; 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 S1752054AbeEQVF6 (ORCPT + 99 others); Thu, 17 May 2018 17:05:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34824 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbeEQVF4 (ORCPT ); Thu, 17 May 2018 17:05:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8D84F60209; Thu, 17 May 2018 21:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526591155; bh=v1fymRXZqvj7KDmWwlZJQJJKx+eBrmH0kA9eBEem4Es=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VLmVIunBhzITWl/Y5l4KuPBWPRTZYqJlG3yp9s+DKdUcBfn9TxT0YpLsPeFGqBdPr vOwrS+uG62Xc4a+QDpVqBCZQ+7c775PjDqca5WFo9GN+zLyyg3TkoMRkqgzyEyizY/ eUby+tX5pwY9vn5sBcchO8Q8idj7yPnkKAFtc4CE= 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 [10.235.228.150] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3839260209; Thu, 17 May 2018 21:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526591154; bh=v1fymRXZqvj7KDmWwlZJQJJKx+eBrmH0kA9eBEem4Es=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KTDeLIHZlqwSqILiUop+kls0WrwWXHW2wT/5/LMcr8HICKDjBK1Pvtltv4jC8HhYq u7m+2VcAnb7xvSLVZ/1WGE/Dqm8lbPVUGosl+L0LDgXF423O+dtODiJ61fTLRLn0H+ 3e/y6zmjQVXzWHBi+h5cvA2IVLtw1x+vWYkLynaE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3839260209 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 Subject: Re: [PATCH] mm/dmapool: localize page allocations To: Matthew Wilcox Cc: linux-mm@kvack.org, timur@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, open list References: <1526578581-7658-1-git-send-email-okaya@codeaurora.org> <20180517181815.GC26718@bombadil.infradead.org> <9844a638-bc4e-46bd-133e-0c82a3e9d6ea@codeaurora.org> <20180517194612.GG26718@bombadil.infradead.org> <20180517204103.GJ26718@bombadil.infradead.org> From: Sinan Kaya Message-ID: Date: Thu, 17 May 2018 17:05:53 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180517204103.GJ26718@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/17/2018 4:41 PM, Matthew Wilcox wrote: > Let's try a different example. I have a four-socket system with one > NVMe device with lots of hardware queues. Each CPU has its own queue > assigned to it. If I allocate all the PRP metadata on the socket with > the NVMe device attached to it, I'm sending a lot of coherency traffic > in the direction of that socket, in addition to the actual data. If the > PRP lists are allocated randomly on the various sockets, the traffic > is heading all over the fabric. If the PRP lists are allocated on the > local socket, the only time those lists move off this node is when the > device requests them. So.., your reasoning is that you actually want to keep the memory as close as possible to the CPU rather than the device itself. CPU would do frequent updates the buffer until the point where it hands off the buffer to the hardware. Device would fetch the memory via coherency when it needs to consume the data but this would be a one time penalty. It sounds logical to me. I was always told that you want to keep buffers as close as possible to the device. Maybe, it makes sense for things that device needs frequent access like receive buffers. If the majority user is CPU, then the buffer needs to be kept closer to the CPU. dma_alloc_coherent() is generally used for receiver buffer allocation in network adapters in general. People allocate a chunk and then create a queue that hardware owns for dumping events and data. Since DMA pool is a generic API, we should maybe request where we want to keep the buffers closer to and allocate buffers from the appropriate NUMA node based on that. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.