All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
To: Mike Christie <mchristi@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: RE: [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore
Date: Wed, 10 Aug 2016 18:16:12 +0530	[thread overview]
Message-ID: <7ab48eaa301e671c8338a2161edd2097@mail.gmail.com> (raw)
In-Reply-To: <57AA1770.6010802@redhat.com>

> -----Original Message-----
> From: Mike Christie [mailto:mchristi@redhat.com]
> Sent: Tuesday, August 09, 2016 11:19 PM
> To: Jitendra Bhivare; Martin K. Petersen
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore
>
> On 08/09/2016 03:29 AM, Jitendra Bhivare wrote:
> >> -----Original Message-----
> >> From: Martin K. Petersen [mailto:martin.petersen@oracle.com]
> >> Sent: Tuesday, August 09, 2016 6:35 AM
> >> To: Mike Christie
> >> Cc: Jitendra Bhivare; linux-scsi@vger.kernel.org
> >> Subject: Re: [PATCH 02/28] be2iscsi: Replace _bh with
> > _irqsave/irqrestore
> >>
> >>>>>>> "Mike" == Mike Christie <mchristi@redhat.com> writes:
> >>
> >>>> In beiscsi_alloc_pdu, _bh versions of spin_lock are being used for
> >>>> protecting SGLs and WRBs. _bh versions are needed as the function
> >>>> gets invoked in process context and BLOCK_IOPOLL softirq.
> >>>>
> >>>> In spin_unlock_bh, after releasing the lock and enabling BH,
> >>>> do_softirq is called which executes till last SOFTIRQ.
> >>>>
> >>>> beiscsi_alloc_pdu is called under session lock. Through block
> >>>> layer, iSCSI stack in some cases send IOs with interrupts disabled.
> >>>> In such paths,
> >>
> >>
> >> Mike> What path is this? Is this with mq enabled or disabled?
> >>
> >> Jitendra?
> >>
> >> --
> >> Martin K. Petersen	Oracle Linux Engineering
> > [JB] Sorry for the delayed response, there was some issue with my mail
> > client.
> > There are paths block layer where IRQs are disabled with request_queue
> > queue_lock.
> > - blk_timeout_work : this triggers NOP-OUT thru' iscsi_eh_cmd_timed_out.
> > - blk_execute_rq_nowait
>
> I am not sure I understand the problem/solution. Why does the patch only
> need
> to modify be2iscsi's locking? Why wouldn't you need to also change the
> libiscsi
> session lock locking? You don't need irqs to be running right? You are
> just doing
> this so the locking calls (irq vs bh) matches up?
>
> Don't you also need to fix the non-mq IO path. scsi_request_fn needs a fix
> to use
> spin_lock_irqsave/spin_unlock_irqrestore because blk_execute_rq_nowait
> already disables them right?
>
[JB] The issue is hard lockup seen on a CPU which is waiting for session
lock taken by another
CPU processing do_softirq. This do_softirq is getting called from be2iscsi
spin_unlock_bh.

The contention gets easily exposed with be2iscsi as it data structures are
accessed in process context
and IRQ_POLL softirq.

iscsi_eh_cmd_timed_out gets saved because it is using base spin_lock version
for session lock (frwd and back).
iscsi_queuecommand is using _bh which is bit scary.

Yes, that needs to be fixed too... and then this other path looks buggy
too -
blk_run_queue (takes queue_lock with irqsave) ->scsi_request_fn (unlocks it
with _irq)

  reply	other threads:[~2016-08-10 18:26 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  9:07 [PATCH 00/28] be2iscsi: driver update 11.2.0.0 Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 01/28] be2iscsi: Fix to use correct configuration values Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore Jitendra Bhivare
2016-08-05 18:38   ` Mike Christie
2016-08-09  1:05     ` Martin K. Petersen
2016-08-09  8:29       ` Jitendra Bhivare
2016-08-09 17:48         ` Mike Christie
2016-08-10 12:46           ` Jitendra Bhivare [this message]
2016-08-11  5:42           ` Jitendra Bhivare
2016-08-12  7:55           ` Jitendra Bhivare
2016-08-12  8:05           ` Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 03/28] be2iscsi: Replace _bh version for mcc_lock spinlock Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 04/28] be2iscsi: Reduce driver load/unload time Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 05/28] be2iscsi: Set and return right iface v4/v6 states Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 06/28] be2iscsi: Fix gateway APIs to support IPv4 & IPv6 Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 07/28] be2iscsi: Fix release of DHCP IP in static mode Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 08/28] be2iscsi: Move VLAN code to common iface_set_param Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 09/28] be2iscsi: Update iface handle before any set param Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 10/28] be2iscsi: Rename iface get/set/create/destroy APIs Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 11/28] be2iscsi: Handle only NET_PARAM in iface_get_param Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 12/28] be2iscsi: Check all zeroes IP before issuing IOCTL Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 13/28] be2iscsi: Remove alloc_mcc_tag & beiscsi_pci_soft_reset Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 14/28] be2iscsi: Remove isr_lock and dead code Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 15/28] be2iscsi: Fix checks for HBA in error state Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 16/28] be2iscsi: Fix to make boot discovery non-blocking Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 17/28] be2iscsi: Fix to add timer for UE detection Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 18/28] be2iscsi: Add IOCTL to check UER supported Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 19/28] be2iscsi: Move functions to right files Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 20/28] be2iscsi: Fix POST check and reset sequence Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 21/28] be2iscsi: Add V1 of EPFW cleanup IOCTL Jitendra Bhivare
2016-07-21  9:07 ` [PATCH 22/28] be2iscsi: Add TPE recovery feature Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 23/28] be2iscsi: Fail the sessions immediately after TPE Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 24/28] be2iscsi: Add FUNCTION_RESET during driver unload Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 25/28] be2iscsi: Fix async PDU handling path Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 26/28] be2iscsi: Update copyright information Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 27/28] be2iscsi: Update the driver version Jitendra Bhivare
2016-07-21  9:08 ` [PATCH 28/28] MAINTAINERS: Update be2iscsi contact info Jitendra Bhivare
2016-08-05  1:38 ` [PATCH 00/28] be2iscsi: driver update 11.2.0.0 Martin K. Petersen
2016-08-05 16:42 ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2016-09-23 15:08 [PATCH 02/28] be2iscsi: Replace _bh with _irqsave/irqrestore Jitendra Bhivare
2016-09-27 10:18 Jitendra Bhivare

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=7ab48eaa301e671c8338a2161edd2097@mail.gmail.com \
    --to=jitendra.bhivare@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mchristi@redhat.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.