2021-01-19 12:37:34

by Lianbo Jiang

[permalink] [raw]
Subject: [PATCH 0/2 v2] iommu: fix the failure of deferred attach for iommu attach device

This patchset is to fix the failure of deferred attach for iommu attach
device, it includes the following two patches:

[1] [PATCH 1/2] dma-iommu: use static-key to minimize the impact in the fast-path
This is a prepared patch for the second one, 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.

[2] [PATCH 2/2] iommu: use the __iommu_attach_device() directly for deferred attach
Move the handling currently in iommu_dma_deferred_attach() into the
iommu core code so that it can call the __iommu_attach_device()
directly instead of the iommu_attach_device(). The external interface
iommu_attach_device() is not suitable for handling this situation.

Changes since v1:
[1] use the __iommu_attach_device() directly for deferred attach
[2] use static-key to minimize the impact in the fast-path

Lianbo Jiang (2):
dma-iommu: use static-key to minimize the impact in the fast-path
iommu: use the __iommu_attach_device() directly for deferred attach

drivers/iommu/dma-iommu.c | 29 +++++++++++------------------
drivers/iommu/iommu.c | 12 ++++++++++++
include/linux/iommu.h | 2 ++
3 files changed, 25 insertions(+), 18 deletions(-)

--
2.17.1


2021-01-19 13:55:22

by Baolu Lu

[permalink] [raw]
Subject: Re: [PATCH 0/2 v2] iommu: fix the failure of deferred attach for iommu attach device

On 2021/1/19 19:16, Lianbo Jiang wrote:
> This patchset is to fix the failure of deferred attach for iommu attach
> device, it includes the following two patches:
>
> [1] [PATCH 1/2] dma-iommu: use static-key to minimize the impact in the fast-path
> This is a prepared patch for the second one, 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.
>
> [2] [PATCH 2/2] iommu: use the __iommu_attach_device() directly for deferred attach
> Move the handling currently in iommu_dma_deferred_attach() into the
> iommu core code so that it can call the __iommu_attach_device()
> directly instead of the iommu_attach_device(). The external interface
> iommu_attach_device() is not suitable for handling this situation.
>
> Changes since v1:
> [1] use the __iommu_attach_device() directly for deferred attach
> [2] use static-key to minimize the impact in the fast-path
>
> Lianbo Jiang (2):
> dma-iommu: use static-key to minimize the impact in the fast-path
> iommu: use the __iommu_attach_device() directly for deferred attach
>
> drivers/iommu/dma-iommu.c | 29 +++++++++++------------------
> drivers/iommu/iommu.c | 12 ++++++++++++
> include/linux/iommu.h | 2 ++
> 3 files changed, 25 insertions(+), 18 deletions(-)
>

Good fix and improvement. For the patches in this series:

Reviewed-by: Lu Baolu <[email protected]>

Best regards,
baolu

2021-01-28 11:09:27

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH 0/2 v2] iommu: fix the failure of deferred attach for iommu attach device

On Tue, Jan 19, 2021 at 07:16:14PM +0800, Lianbo Jiang wrote:
> Lianbo Jiang (2):
> dma-iommu: use static-key to minimize the impact in the fast-path
> iommu: use the __iommu_attach_device() directly for deferred attach
>
> drivers/iommu/dma-iommu.c | 29 +++++++++++------------------
> drivers/iommu/iommu.c | 12 ++++++++++++
> include/linux/iommu.h | 2 ++
> 3 files changed, 25 insertions(+), 18 deletions(-)

Applied, thanks.