2022-02-08 11:30:18

by John Garry

[permalink] [raw]
Subject: Re: [PATCH v1 04/10] iommu/vt-d: Remove iova_cache_get/put()

On 07/02/2022 06:41, Lu Baolu wrote:
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index 583ec0fa4ac1..e8d58654361c 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -3348,9 +3348,6 @@ static inline int iommu_devinfo_cache_init(void)
> static int __init iommu_init_mempool(void)
> {
> int ret;
> - ret = iova_cache_get();
> - if (ret)
> - return ret;
>
> ret = iommu_domain_cache_init();
> if (ret)
> @@ -3362,7 +3359,6 @@ static int __init iommu_init_mempool(void)
>
> kmem_cache_destroy(iommu_domain_cache);
> domain_error:

nit: is this label still really required? only failures in
iommu_domain_cache_init() jump to it, and that can return directly now.

Thanks,
John

> - iova_cache_put();



2022-02-09 12:14:54

by Lu Baolu

[permalink] [raw]
Subject: Re: [PATCH v1 04/10] iommu/vt-d: Remove iova_cache_get/put()

On 2/7/22 6:39 PM, John Garry wrote:
> On 07/02/2022 06:41, Lu Baolu wrote:
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index 583ec0fa4ac1..e8d58654361c 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -3348,9 +3348,6 @@ static inline int iommu_devinfo_cache_init(void)
>>   static int __init iommu_init_mempool(void)
>>   {
>>       int ret;
>> -    ret = iova_cache_get();
>> -    if (ret)
>> -        return ret;
>>       ret = iommu_domain_cache_init();
>>       if (ret)
>> @@ -3362,7 +3359,6 @@ static int __init iommu_init_mempool(void)
>>       kmem_cache_destroy(iommu_domain_cache);
>>   domain_error:
>
> nit: is this label still really required? only failures in
> iommu_domain_cache_init() jump to it, and that can return directly now.

It will be cleaned up in the next patch.

>
> Thanks,
> John
>
>> -    iova_cache_put();
>

Best regards,
baolu