Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3679904imm; Thu, 17 May 2018 12:46:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8TUDL+OaiNWz+NItEJIYihcSavjnMNthw9A0Zbn11C/18VYZk3Nw81PV5oj3L5zLfbtqV X-Received: by 2002:a62:99d7:: with SMTP id t84-v6mr6402507pfk.252.1526586403592; Thu, 17 May 2018 12:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526586403; cv=none; d=google.com; s=arc-20160816; b=R8+gXKfQYNPk/ymcAWNOewxJYJTI+qIUBsJxNthyx5tQJmBR4O8ZQcYDcLvhD/eDz7 y/XqgTNCVpwwN8AgjbZjzRU2XEzS/UWzKyJLN9xu1FNFMmP4/oPEkq60XcgTEG1cApGi qGbOCzdEd9IaMcOs/nj2u/Nv1AAtxT1KUC+xeAh430u6ukLabyyPm2wIyXB/+9G5DGPL U0zPJwHhwfyhRVUlcKAqR3eLfTouIwT9XjgBPKVnGsmWtn+gFq5GBLjRjmI4SeGfhDx9 SDNDDoHf2lRRWcLqZdwiPWyX/ddn/W+i/uusPAOhECHlZuItKUBzdhaINzsdLIbqBSiG ZsHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=F4R9D+chszApysXA2KXTaTrp+tr8Prjj5/JIUacGdMw=; b=EFN2qIos4vLq8ihDeu5w1DsUBDTxyTpOekwFrbbzC422werQ5KHuIMcFilDLwxbbLv TTmpzKGJVHqmBLTZyCyPeP9Hirmq0157oE/FjGpvvV18zXnkYcmzdCh+OAc4uCZb0L9o d+2MHt89jjUxeRdB5cl8V8qLrHminuHnqHBIFhNGgm5iq1xE3GCmk4ixZmrXh+s8yd9k IuNUZMaEJppCSF75397UFIlOvDvy5gitk3yorqQyyysjsmrOSXVKmz5Wi2DdOzfCbPh2 Wym2Gs4I+OCn5BS/nWfYTHAj1nQ/EKKSRc650lej/n9wh4IjaMX2uZn/ZHu2paky23I/ FAgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=csTiU8c5; 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 w184-v6si192208pgb.482.2018.05.17.12.46.27; Thu, 17 May 2018 12:46:43 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=csTiU8c5; 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 S1751879AbeEQTqP (ORCPT + 99 others); Thu, 17 May 2018 15:46:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41394 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbeEQTqO (ORCPT ); Thu, 17 May 2018 15:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F4R9D+chszApysXA2KXTaTrp+tr8Prjj5/JIUacGdMw=; b=csTiU8c55iAyIxE4CagduJRvK lrcMdArRT15n4r3T1xKG7hkWQSJI6TbGotEOimNd6RHoeI+8D6/S7Iv6ZO3RMApXNZTaix+MisXkQ EgLvsCs4oNbMCZrJnsPFxEPTwSrlAMhnbf9azYfvqzAVKKAxx6hoMOhVehq4zFDm+YTnQ4y+LOtyP poVosSYbFplMVJgK/z+aQhzx6MXwHzRuXkT0czLq73X0s/dHU0CO+Y+bHAYF95ODlvfx7iS76uTcd jIIVKBTlD3lKd5NSpVvY4Uvm+L3/uGErB/MKTDcpA1W+1IJNxzLQ73GoHJ7UJBaC5msoqTXfUvt+Y WcA08MsTA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJOqr-0006mf-3P; Thu, 17 May 2018 19:46:13 +0000 Date: Thu, 17 May 2018 12:46:12 -0700 From: Matthew Wilcox To: Sinan Kaya Cc: linux-mm@kvack.org, timur@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, open list Subject: Re: [PATCH] mm/dmapool: localize page allocations Message-ID: <20180517194612.GG26718@bombadil.infradead.org> References: <1526578581-7658-1-git-send-email-okaya@codeaurora.org> <20180517181815.GC26718@bombadil.infradead.org> <9844a638-bc4e-46bd-133e-0c82a3e9d6ea@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9844a638-bc4e-46bd-133e-0c82a3e9d6ea@codeaurora.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 03:37:21PM -0400, Sinan Kaya wrote: > On 5/17/2018 2:18 PM, Matthew Wilcox wrote: > > On Thu, May 17, 2018 at 01:36:19PM -0400, Sinan Kaya wrote: > >> 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(). > > Have you measured any performance gains by doing this? The thing is that > > these allocations are for the metadata about the page, and the page is > > going to be used by CPUs in every node. So it's not clear to me that > > allocating it on the node nearest to the device is going to be any sort > > of a win. > > > > It is true that this is metadata but it is one of the things that is most > frequently used in spite of its small size. > > I don't think it makes any sense to cross a chip boundary for accessing a > pointer location on every single pool allocation. > > Remember that the CPU core that is running this driver is most probably on > the same NUMA node as the device itself. Umm ... says who? If my process is running on NUMA node 5 and I submit an I/O, it should be allocating from a pool on node 5, not from a pool on whichever node the device is attached to. If it actually makes a performance difference, then NVMe should allocate one pool per queue, rather than one pool per device like it currently does. > Also, if it was a one time init kind of thing, I'd say "yeah, leave it alone". > DMA pool is used by a wide range of drivers and it is used to allocate > fixed size buffers at runtime. * DMA Pool allocator * * Copyright 2001 David Brownell * Copyright 2007 Intel Corporation * Author: Matthew Wilcox I know what it's used for.