[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dd162258-bd3d-af1d-179c-e9d412f3f5c4@oracle.com>
Date: Fri, 12 Aug 2022 11:12:54 -0500
From: Mike Christie <michael.christie@...cle.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] scsi: target: Save a few cycles in
'transport_lookup_[cmd|tmr]_lun()'
On 11/3/21 4:24 PM, Christophe JAILLET wrote:
> Use 'percpu_ref_tryget_live_rcu()' instead of 'percpu_ref_tryget_live()' to
> save a few cycles when it is known that the rcu lock is already
> taken/released.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> drivers/target/target_core_device.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
> index 44bb380e7390..bfd5d5606522 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -77,7 +77,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd)
>
> se_lun = rcu_dereference(deve->se_lun);
>
> - if (!percpu_ref_tryget_live(&se_lun->lun_ref)) {
> + if (!percpu_ref_tryget_live_rcu(&se_lun->lun_ref)) {
> se_lun = NULL;
> goto out_unlock;
> }
> @@ -154,7 +154,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd)
> if (deve) {
> se_lun = rcu_dereference(deve->se_lun);
>
> - if (!percpu_ref_tryget_live(&se_lun->lun_ref)) {
> + if (!percpu_ref_tryget_live_rcu(&se_lun->lun_ref)) {
> se_lun = NULL;
> goto out_unlock;
> }
The patch looks ok.
You just got a little unlucky because the Martin just put some
conflicting patches into his 5.20 staging branch:
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/log/?h=5.20/scsi-staging
so I think you want to build your patch against that tree and branch.
Powered by blists - more mailing lists