Re: [PATCH 1/2 v2] dma-iommu: use static-key to minimize the impact in the fast-path

2021-01-21 Thread lijiang
Hi, Christoph Thanks for the comment. 在 2021年01月19日 23:26, Christoph Hellwig 写道: > On Tue, Jan 19, 2021 at 07:16:15PM +0800, Lianbo Jiang wrote: >> +static DEFINE_STATIC_KEY_FALSE(__deferred_attach); > Why the strange underscores? Wouldn't iommu_deferred_attach_enabled The variable is defined wi

Re: [PATCH 1/2 v2] dma-iommu: use static-key to minimize the impact in the fast-path

2021-01-19 Thread Robin Murphy
On 2021-01-19 15:26, Christoph Hellwig wrote: On Tue, Jan 19, 2021 at 07:16:15PM +0800, Lianbo Jiang wrote: +static DEFINE_STATIC_KEY_FALSE(__deferred_attach); Why the strange underscores? Wouldn't iommu_deferred_attach_enabled be a better name? - if (unlikely(iommu_dma_deferred_attac

Re: [PATCH 1/2 v2] dma-iommu: use static-key to minimize the impact in the fast-path

2021-01-19 Thread Christoph Hellwig
On Tue, Jan 19, 2021 at 07:16:15PM +0800, Lianbo Jiang wrote: > +static DEFINE_STATIC_KEY_FALSE(__deferred_attach); Why the strange underscores? Wouldn't iommu_deferred_attach_enabled be a better name? > - if (unlikely(iommu_dma_deferred_attach(dev, domain))) > + if (static_branch_unlike

[PATCH 1/2 v2] dma-iommu: use static-key to minimize the impact in the fast-path

2021-01-19 Thread Lianbo Jiang
Let's move out the is_kdump_kernel() check from iommu_dma_deferred_attach() to iommu_dma_init(), and use the static-key in the fast-path to minimize the impact in the normal case. Signed-off-by: Lianbo Jiang Co-developed-by: Robin Murphy Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.