From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Tyrel Datwyler <tyreld@linux.ibm.com>,
ejb@linux.ibm.com, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com, tglx@linutronix.de,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 08/10] scsi/ibmvfc: Replace tasklet with work
Date: Thu, 9 Jun 2022 14:30:17 +0200 [thread overview]
Message-ID: <YqHn2Rn5nePSJ0PG@linutronix.de> (raw)
In-Reply-To: <20220530231512.9729-9-dave@stgolabs.net>
On 2022-05-30 16:15:10 [-0700], Davidlohr Bueso wrote:
> diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
> index d0eab5700dc5..31b1900489e7 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc.c
> +++ b/drivers/scsi/ibmvscsi/ibmvfc.c
> @@ -891,7 +891,7 @@ static void ibmvfc_release_crq_queue(struct ibmvfc_host *vhost)
>
> ibmvfc_dbg(vhost, "Releasing CRQ\n");
> free_irq(vdev->irq, vhost);
> - tasklet_kill(&vhost->tasklet);
> + cancel_work_sync(&vhost->work);
s/ {8}/\t/
is there a reason not to use threaded interrupts? The workqueue _might_
migrate to another CPU. The locking ensures that nothing bad happens but
ibmvfc_tasklet() has this piece:
| spin_lock_irqsave(vhost->host->host_lock, flags);
…
| while ((async = ibmvfc_next_async_crq(vhost)) != NULL) {
| ibmvfc_handle_async(async, vhost);
| async->valid = 0;
| wmb();
| }
…
| vio_enable_interrupts(vdev);
potentially enables interrupts which fires right away.
| if ((async = ibmvfc_next_async_crq(vhost)) != NULL) {
| vio_disable_interrupts(vdev);
disables it again.
| }
|
| spin_unlock(vhost->crq.q_lock);
| spin_unlock_irqrestore(vhost->host->host_lock, flags);
If the worker runs on another CPU then the CPU servicing the interrupt
will be blocked on the lock which is not nice.
My guess is that you could enable interrupts right before unlocking but
is a different story.
> do {
> if (rc)
> msleep(100);
Sebastian
next prev parent reply other threads:[~2022-06-09 12:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220530231512.9729-1-dave@stgolabs.net>
2022-05-30 23:15 ` [PATCH 06/10] scsi/ibmvscsi_tgt: Replace work tasklet with threaded irq Davidlohr Bueso
2022-06-03 11:05 ` Sebastian Andrzej Siewior
2022-05-30 23:15 ` [PATCH 08/10] scsi/ibmvfc: Replace tasklet with work Davidlohr Bueso
2022-06-09 12:30 ` Sebastian Andrzej Siewior [this message]
2022-06-28 15:18 ` Davidlohr Bueso
2022-05-30 23:15 ` [PATCH 09/10] scsi/ibmvscsi: Replace srp " Davidlohr Bueso
2022-06-09 15:02 ` Sebastian Andrzej Siewior
2022-06-09 15:46 ` David Laight
2022-06-14 13:25 ` 'Sebastian Andrzej Siewior'
2022-06-14 13:34 ` David Laight
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=YqHn2Rn5nePSJ0PG@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=dave@stgolabs.net \
--cc=ejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=martin.petersen@oracle.com \
--cc=tglx@linutronix.de \
--cc=tyreld@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).