lkml.org 
[lkml]   [2018]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 068/141] scsi: lpfc: Correct soft lockup when running mds diagnostics
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: James Smart <jsmart2021@gmail.com>

    [ Upstream commit 0ef01a2d95fd62bb4f536e7ce4d5e8e74b97a244 ]

    When running an mds diagnostic that passes frames with the switch, soft
    lockups are detected. The driver is in a CQE processing loop and has
    sufficient amount of traffic that it never exits the ring processing routine,
    thus the "lockup".

    Cap the number of elements in the work processing routine to 64 elements. This
    ensures that the cpu will be given up and the handler reschedule to process
    additional items.

    Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: James Smart <james.smart@broadcom.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/scsi/lpfc/lpfc_sli.c | 7 +++++++
    1 file changed, 7 insertions(+)

    --- a/drivers/scsi/lpfc/lpfc_sli.c
    +++ b/drivers/scsi/lpfc/lpfc_sli.c
    @@ -3512,6 +3512,7 @@ lpfc_sli_handle_slow_ring_event_s4(struc
    struct hbq_dmabuf *dmabuf;
    struct lpfc_cq_event *cq_event;
    unsigned long iflag;
    + int count = 0;

    spin_lock_irqsave(&phba->hbalock, iflag);
    phba->hba_flag &= ~HBA_SP_QUEUE_EVT;
    @@ -3533,16 +3534,22 @@ lpfc_sli_handle_slow_ring_event_s4(struc
    if (irspiocbq)
    lpfc_sli_sp_handle_rspiocb(phba, pring,
    irspiocbq);
    + count++;
    break;
    case CQE_CODE_RECEIVE:
    case CQE_CODE_RECEIVE_V1:
    dmabuf = container_of(cq_event, struct hbq_dmabuf,
    cq_event);
    lpfc_sli4_handle_received_buffer(phba, dmabuf);
    + count++;
    break;
    default:
    break;
    }
    +
    + /* Limit the number of events to 64 to avoid soft lockups */
    + if (count == 64)
    + break;
    }
    }


    \
     
     \ /
      Last update: 2018-11-11 23:40    [W:3.012 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site