From: Tony Battersby <tonyb@cybernetics.com>
To: kbusch@kernel.org
Cc: kernel-team@fb.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, willy@infradead.org
Subject: Re: [PATCH 0/2] dmapool performance enhancements
Date: Fri, 27 May 2022 15:35:47 -0400 [thread overview]
Message-ID: <156da4ae-20de-a40f-5173-3b02c779b43c@cybernetics.com> (raw)
In-Reply-To: <20220428202714.17630-1-kbusch@kernel.org>
I posted a similar patch series back in 2018:
https://lore.kernel.org/linux-mm/73ec1f52-d758-05df-fb6a-41d269e910d0@cybernetics.com/
https://lore.kernel.org/linux-mm/15ff502d-d840-1003-6c45-bc17f0d81262@cybernetics.com/
https://lore.kernel.org/linux-mm/1288e597-a67a-25b3-b7c6-db883ca67a25@cybernetics.com/
I initially used a red-black tree keyed by the DMA address, but then for
v2 of the patchset I put the dma pool info directly into struct page and
used virt_to_page() to get at it. But it turned out that was a bad idea
because not all architectures have struct page backing
dma_alloc_coherent():
https://lore.kernel.org/linux-kernel/20181206013054.GI6707@atomide.com/
I intended to go back and resubmit the red-black tree version, but I was
too busy at the time and forgot about it. A few days ago I finally
decided to update the patches and submit them upstream. I found your
recent dmapool xarray patches by searching the mailing list archive to
see if anyone else was working on something similar.
Using the following as a benchmark:
modprobe mpt3sas
drivers/scsi/mpt3sas/mpt3sas_base.c
_base_allocate_chain_dma_pool
loop dma_pool_alloc(ioc->chain_dma_pool)
rmmod mpt3sas
drivers/scsi/mpt3sas/mpt3sas_base.c
_base_release_memory_pools()
loop dma_pool_free(ioc->chain_dma_pool)
Here are the benchmark results showing the speedup from the patchsets:
modprobe rmmod
orig 1x 1x
xarray 5.2x 186x
rbtree 9.3x 269x
It looks like my red-black tree version is faster than the v1 of the
xarray patch on this benchmark at least, although the mpt3sas usage of
dmapool is hardly typical. I will try to get some testing done on my
patchset and post it next week.
Tony Battersby
Cybernetics
next prev parent reply other threads:[~2022-05-27 19:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 20:27 kbusch
2022-04-28 20:27 ` [PATCH 1/2] mm/dmapool: replace linked list with xarray kbusch
2022-04-28 21:59 ` Matthew Wilcox
2022-04-29 1:41 ` Keith Busch
2022-04-28 20:27 ` [PATCH 2/2] mm/dmapool: link blocks across pages kbusch
2022-05-27 19:35 ` Tony Battersby [this message]
2022-05-27 21:01 ` [PATCH 0/2] dmapool performance enhancements Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=156da4ae-20de-a40f-5173-3b02c779b43c@cybernetics.com \
--to=tonyb@cybernetics.com \
--cc=kbusch@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox