From: Brian Johannesmeyer <bjohannesmeyer@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org,
Raphael Isemann <teemperor@gmail.com>,
Cristiano Giuffrida <giuffrida@cs.vu.nl>,
Herbert Bos <h.j.bos@vu.nl>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [RFC v2 0/2] dmapool: Mitigate device-controllable mem. corruption
Date: Wed, 20 Nov 2024 14:58:54 -0700 [thread overview]
Message-ID: <CAOZ5it1v3zxiavxctm-d32bT9aO701Os1-EnEeG0KCUhBPLMnw@mail.gmail.com> (raw)
In-Reply-To: <Zz4vzSRcdjvWNIgK@kbusch-mbp>
> You should probably Cc Keith as the person who most recently did major
> work on the dmpool code and might still remember how it works.
Thank you for adding him, and apologies for not including him initially.
> The intrusive list was overlayed in the freed blocks for spatial
> optimizations. If you're moving these field outside of it (I'll have to
> review the patch on lore), you can probably relax the minimum dma block
> size too since we don't need to hold the data structure information in
> it.
I see. AFAICT, relaxing the minimum DMA block size would just mean
removing these lines from `dma_pool_create()`:
```
if (size < sizeof(struct dma_block))
size = sizeof(struct dma_block);
```
> Could you rerun your tests without DMAPOOL_DEBUG enabled? That's the
> more interesting kernel setup for performance comparisions.
Sure, that makes sense. Here are the results with DMAPOOL_DEBUG disabled:
**Without the patches applied:**
```
dmapool test: size:16 align:16 blocks:8192 time:11860
dmapool test: size:64 align:64 blocks:8192 time:11951
dmapool test: size:256 align:256 blocks:8192 time:12287
dmapool test: size:1024 align:1024 blocks:2048 time:3134
dmapool test: size:4096 align:4096 blocks:1024 time:1686
dmapool test: size:68 align:32 blocks:8192 time:12050
```
**With the patches applied:**
```
dmapool test: size:16 align:16 blocks:8192 time:34432
dmapool test: size:64 align:64 blocks:8192 time:62262
dmapool test: size:256 align:256 blocks:8192 time:238137
dmapool test: size:1024 align:1024 blocks:2048 time:61386
dmapool test: size:4096 align:4096 blocks:1024 time:75342
dmapool test: size:68 align:32 blocks:8192 time:88243
```
These results are consistent across multiple runs. It seems that with
DMAPOOL_DEBUG disabled, the patches introduce a significant
performance hit. Let me know if you have any suggestions or further
tests you'd like me to run.
Thanks,
Brian Johannesmeyer
next prev parent reply other threads:[~2024-11-20 21:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 20:55 Brian Johannesmeyer
2024-11-19 20:55 ` [RFC v2 1/2] dmapool: Move pool metadata into non-DMA memory Brian Johannesmeyer
2024-11-20 9:37 ` Christoph Hellwig
2024-11-20 23:46 ` Brian Johannesmeyer
2024-11-21 5:03 ` Christoph Hellwig
2024-11-21 17:48 ` Brian Johannesmeyer
2024-11-19 20:55 ` [RFC v2 2/2] dmapool: Use pool_find_block() in pool_block_err() Brian Johannesmeyer
2024-11-19 22:14 ` [RFC v2 0/2] dmapool: Mitigate device-controllable mem. corruption Greg KH
2024-11-19 22:22 ` Brian Johannesmeyer
2024-11-20 9:29 ` Christoph Hellwig
2024-11-20 15:56 ` Keith Busch
2024-11-20 18:51 ` Keith Busch
2024-11-20 21:58 ` Brian Johannesmeyer [this message]
2024-11-21 3:37 ` Keith Busch
2024-11-21 17:31 ` Brian Johannesmeyer
2024-11-21 18:06 ` Keith Busch
2024-11-21 19:07 ` Brian Johannesmeyer
2024-11-22 19:19 ` Brian Johannesmeyer
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=CAOZ5it1v3zxiavxctm-d32bT9aO701Os1-EnEeG0KCUhBPLMnw@mail.gmail.com \
--to=bjohannesmeyer@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=giuffrida@cs.vu.nl \
--cc=gregkh@linuxfoundation.org \
--cc=h.j.bos@vu.nl \
--cc=hch@infradead.org \
--cc=kbusch@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=teemperor@gmail.com \
/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