Re: [PATCH v2] iommu/iova: Optimize alloc_iova with rbtree_augmented
From: Peng Zhang
Date: Thu Sep 01 2022 - 23:31:46 EST
If you really have a performance issue with alloc_iova_fast() ->
alloc_iova() then I suggest that you consider trying to use
dma_opt_mapping_size() to teach the DMA engine driver to not create
requests whose overall size exceeds to the rcache limit.
Yes. But I don't think it essentially solves the problem.
A library for users should run stably ant it shouldn't hold
the spinlock for a long time in some cases. It can even be
said to be a bug.
Like this:
[Wed May 25 05:27:59 2022] watchdog: BUG: soft lockup - CPU#58
stuck for 23s!
[Wed May 25 05:27:59 2022] Call Trace:
[Wed May 25 05:27:59 2022] alloc_iova+0xf2/0x140
[Wed May 25 05:27:59 2022] alloc_iova_fast+0x56/0x251
Now we avoid this problem with iommu=pt, but it didn't solve the problem.
Thanks,
Peng