From patchwork Thu Apr 28 20:27:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 12831139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83734C433FE for ; Thu, 28 Apr 2022 20:27:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 701B66B0085; Thu, 28 Apr 2022 16:27:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 688746B0087; Thu, 28 Apr 2022 16:27:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 504B16B0089; Thu, 28 Apr 2022 16:27:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 1D3F96B0087 for ; Thu, 28 Apr 2022 16:27:20 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id E27C11226B1 for ; Thu, 28 Apr 2022 20:27:19 +0000 (UTC) X-FDA: 79407422598.17.6D3B132 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 43A7AC0055 for ; Thu, 28 Apr 2022 20:27:09 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B0470B82D67; Thu, 28 Apr 2022 20:27:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B040C385A9; Thu, 28 Apr 2022 20:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651177636; bh=YKrkZHxqYNC4b47dzEJd7QF/x5JY1uUrl+Y3fepaybc=; h=From:To:Cc:Subject:Date:From; b=kwq8nLA3r2WP3nULA1nKkx5pLAHhJqFXhF6P8nAIuEbSSlwcaEL7ukk1oXB0+0tyg JKuI0u79uz41rcI71LnK5EH9spwnKjJ/Qb/oF/ti0Tn4SPizAzwx2WYj+3uw96po/T 9yMkaxH3ADaiCTRE/MSBGTBzPm7YNogKCocu8h/rU/i4gMcfAsYvqKOjcrE/EoqqhH EZXnfS3zI3DEJ4AIcu1pDPyT7fbjz+3n11RW1KT09MFy7EnEaguCWi2kY5yvutp2Kn OoTnREW/82xjhELdHb9heLHM6xf4NimHnJFFZE7HjbmfPRU0GI9SSg0Z6XKx9ITaqq g6W+WYfg04YKQ== From: kbusch@kernel.org To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: willy@infradead.org, kernel-team@fb.com, Keith Busch Subject: [PATCH 0/2] dmapool performance enhancements Date: Thu, 28 Apr 2022 14:27:12 -0600 Message-Id: <20220428202714.17630-1-kbusch@kernel.org> X-Mailer: git-send-email 2.17.2 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 43A7AC0055 X-Stat-Signature: bxkmsn6xnffbpmdf79qh11b3bmbjifxb X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kwq8nLA3; spf=pass (imf10.hostedemail.com: domain of kbusch@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=kbusch@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1651177629-771534 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000010, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Keith Busch Allocating and freeing blocks from the dmapool iterates a list of all allocated pages. We can save time removing the per-alloc/free list traversal for a constant time lookup, so this series does that. Compared to current kernel, perf record from running io_uring benchmarks on nvme reports dma_pool_alloc() cost reduction cut in half from 0.81% to 0.41%. Keith Busch (2): mm/dmapool: replace linked list with xarray mm/dmapool: link blocks across pages mm/dmapool.c | 107 +++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 51 deletions(-)