mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: Stanley Chu <stanley.chu@mediatek.com>,
	Can Guo <cang@codeaurora.org>, Bean Huo <beanhuo@micron.com>,
	Asutosh Das <asutoshd@codeaurora.org>
Subject: Re: [PATCH] scsi: ufs: add missing host_lock in setup_xfer_req
Date: Wed, 14 Jul 2021 23:22:24 +0200	[thread overview]
Message-ID: <5f6b14c0a86e419b05102599602307a4782d8c64.camel@gmail.com> (raw)
In-Reply-To: <b0cd26d0-6ebc-b633-8669-a558597cc91d@acm.org>

On Wed, 2021-07-14 at 11:09 -0700, Bart Van Assche wrote:
> On 7/13/21 12:45 PM, Bean Huo wrote:
> 
> > This change only impacts on the Samsung exynos platform. and Can's
> > optimization patch is to optimise the host_lock,, and removed
> > host_lock, now add back in this function makes sense to me.
> > but I am thinking how about hba->host_sem?
> 
> 
> Hi Bean,
> 
> 
> 
> Calls of exynos_ufs_specify_nexus_t_xfer_req() must be serialized,
> hence 
> 
> Jaegeuks' patch. This function is called from the I/O submission path
> so 
> 
> performance matters. My understanding is that spinlocks have less 
> 
> overhead than semaphores. Hence the choice for a spinlock.
> 
> 
> 
> Thanks,

> 
Bart,

After adding spin_lock/unlock_irqsave()
in ufshcd_vops_setup_xfer_req(), there will be 4 times of call of
host_lock lock/unlock in ufshcd_send_command(). Reduce the code scope
of protection, but increase the number of calls to
spin_lock/unlock_irqsave().  Almost each sub-funciton
in ufshcd_send_command() calls spin_lock/unlock_irqsave(). why not
directly take spin_lock/unlock_irqsave() away from each sub-fun, and
increase the scope in ufshcd_send_command()?

Bean







> Bart


      reply	other threads:[~2021-07-14 21:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  0:51 Jaegeuk Kim
2021-07-01 15:23 ` Bart Van Assche
2021-07-01 17:00   ` Bart Van Assche
2021-07-13 19:06 ` Bart Van Assche
2021-07-13 19:45   ` Bean Huo
2021-07-14 18:09     ` Bart Van Assche
2021-07-14 21:22       ` Bean Huo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f6b14c0a86e419b05102599602307a4782d8c64.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=asutoshd@codeaurora.org \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®