All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] mpt3sas: Add io_uring iopoll support
Date: Mon, 30 Aug 2021 22:45:19 +0530	[thread overview]
Message-ID: <CAK=zhgoVGQ=3V2J_SyoZLX2o+qC-0Z0ii26TshaivChfKt-zTQ@mail.gmail.com> (raw)
In-Reply-To: <3efd607c-43df-4c2a-7948-de794b414406@acm.org>

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

On Mon, Aug 30, 2021 at 8:10 AM Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 7/27/21 01:12, Sreekanth Reddy wrote:
> > +     /*
> > +      * wait for current poll to complete.
> > +      */
> > +     for (qid = 0; qid < iopoll_q_count; qid++) {
> > +             while (atomic_read(&ioc->io_uring_poll_queues[qid].busy))
> > +                     udelay(500);
> > +     }
>
> So this loop busy-waits without calling cpu_relax()? That's not OK ...

I will post a new patch for calling this cpu_relax() API.

>
> An additional question: is mpt3sas_base_hard_reset_handler() the only
> function that calls mpt3sas_base_pause_mq_polling() and
> mpt3sas_base_resume_mq_polling()? If so, why have these functions been
> introduced since the SCSI core guarantees that all pending requests
> either have failed or have timed out before the SCSI error handler is
> invoked?

Hard reset is even called from IOCTL path while performing the IOC
firmware update operation, it is also called to recover the IOC from
fault state. During hard reset operation the driver returns all the
outstanding SCSI IO commands with DID_RESET host byte asking the SCSI
core to retry these IOs. So, before flushing out the outstanding IO
commands driver has to pause the mq polling to avoid the race
condition of completing the same SCSI IO command from two paths.

>
> Thanks,
>
> Bart.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

      reply	other threads:[~2021-08-30 17:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  8:12 [PATCH] mpt3sas: Add io_uring iopoll support Sreekanth Reddy
2021-08-10  3:11 ` Martin K. Petersen
2021-08-17  3:20 ` Martin K. Petersen
2021-08-30  2:40 ` Bart Van Assche
2021-08-30 17:15   ` Sreekanth Reddy [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='CAK=zhgoVGQ=3V2J_SyoZLX2o+qC-0Z0ii26TshaivChfKt-zTQ@mail.gmail.com' \
    --to=sreekanth.reddy@broadcom.com \
    --cc=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.