Re: [PATCH] scsi: core: Switch to kvfree_rcu() API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 15, 2021 at 12:18:45PM +0100, Uladzislau Rezki (Sony) wrote:
> Instead of invoking a synchronize_rcu() to free a pointer
> after a grace period we can directly make use of new API
> that does the same but in more efficient way.
> 
> TO: James E.J. Bottomley <jejb@xxxxxxxxxxxxx>
> TO: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
> TO: linux-scsi@xxxxxxxxxxxxxxx
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 3 +--
>  drivers/scsi/device_handler/scsi_dh_rdac.c | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 37d06f993b76..308246ce346a 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -1238,8 +1238,7 @@ static void alua_bus_detach(struct scsi_device *sdev)
>  		kref_put(&pg->kref, release_port_group);
>  	}
>  	sdev->handler_data = NULL;
> -	synchronize_rcu();
> -	kfree(h);
> +	kvfree_rcu(h);
>  }
>  
>  static struct scsi_device_handler alua_dh = {
> diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
> index 66652ab409cc..dc687021ff3a 100644
> --- a/drivers/scsi/device_handler/scsi_dh_rdac.c
> +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
> @@ -782,8 +782,7 @@ static void rdac_bus_detach( struct scsi_device *sdev )
>  	}
>  	spin_unlock(&list_lock);
>  	sdev->handler_data = NULL;
> -	synchronize_rcu();
> -	kfree(h);
> +	kvfree_rcu(h);
>  }
>  
>  static struct scsi_device_handler rdac_dh = {
> -- 
> 2.30.2
> 
+ James E.J. Bottomley <jejb@xxxxxxxxxxxxx>
+ Martin K. Petersen <martin.petersen@xxxxxxxxxx>
+ linux-scsi@xxxxxxxxxxxxxxx

--
Vlad Rezki



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux