diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-06-14 22:52:53 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:28 -0400 |
commit | 5e9d9b8276980fc5dfa88ce34f6ec88ce3026232 (patch) | |
tree | 30b495edab629068f929a32f88a66ad705687f34 /drivers/scsi/lpfc/lpfc_els.c | |
parent | 0d2b6b83030d6a88cbf7db57f84f2daf0e0b251b (diff) |
[SCSI] lpfc 8.2.7 : Rework the worker thread
Rework of the worker thread to make it more efficient.
Make a finer-grain notfication of pending work so less time is
spent checking conditions. Also made other general cleanups.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d418c7c1251e..5d69dee85a8d 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -1813,11 +1813,11 @@ lpfc_els_retry_delay(unsigned long ptr) | |||
1813 | * count until the queued work is done | 1813 | * count until the queued work is done |
1814 | */ | 1814 | */ |
1815 | evtp->evt_arg1 = lpfc_nlp_get(ndlp); | 1815 | evtp->evt_arg1 = lpfc_nlp_get(ndlp); |
1816 | evtp->evt = LPFC_EVT_ELS_RETRY; | 1816 | if (evtp->evt_arg1) { |
1817 | list_add_tail(&evtp->evt_listp, &phba->work_list); | 1817 | evtp->evt = LPFC_EVT_ELS_RETRY; |
1818 | if (phba->work_wait) | 1818 | list_add_tail(&evtp->evt_listp, &phba->work_list); |
1819 | lpfc_worker_wake_up(phba); | 1819 | lpfc_worker_wake_up(phba); |
1820 | 1820 | } | |
1821 | spin_unlock_irqrestore(&phba->hbalock, flags); | 1821 | spin_unlock_irqrestore(&phba->hbalock, flags); |
1822 | return; | 1822 | return; |
1823 | } | 1823 | } |
@@ -3802,20 +3802,17 @@ lpfc_els_timeout(unsigned long ptr) | |||
3802 | { | 3802 | { |
3803 | struct lpfc_vport *vport = (struct lpfc_vport *) ptr; | 3803 | struct lpfc_vport *vport = (struct lpfc_vport *) ptr; |
3804 | struct lpfc_hba *phba = vport->phba; | 3804 | struct lpfc_hba *phba = vport->phba; |
3805 | uint32_t tmo_posted; | ||
3805 | unsigned long iflag; | 3806 | unsigned long iflag; |
3806 | 3807 | ||
3807 | spin_lock_irqsave(&vport->work_port_lock, iflag); | 3808 | spin_lock_irqsave(&vport->work_port_lock, iflag); |
3808 | if ((vport->work_port_events & WORKER_ELS_TMO) == 0) { | 3809 | tmo_posted = vport->work_port_events & WORKER_ELS_TMO; |
3810 | if (!tmo_posted) | ||
3809 | vport->work_port_events |= WORKER_ELS_TMO; | 3811 | vport->work_port_events |= WORKER_ELS_TMO; |
3810 | spin_unlock_irqrestore(&vport->work_port_lock, iflag); | 3812 | spin_unlock_irqrestore(&vport->work_port_lock, iflag); |
3811 | 3813 | ||
3812 | spin_lock_irqsave(&phba->hbalock, iflag); | 3814 | if (!tmo_posted) |
3813 | if (phba->work_wait) | 3815 | lpfc_worker_wake_up(phba); |
3814 | lpfc_worker_wake_up(phba); | ||
3815 | spin_unlock_irqrestore(&phba->hbalock, iflag); | ||
3816 | } | ||
3817 | else | ||
3818 | spin_unlock_irqrestore(&vport->work_port_lock, iflag); | ||
3819 | return; | 3816 | return; |
3820 | } | 3817 | } |
3821 | 3818 | ||
@@ -4769,18 +4766,16 @@ lpfc_fabric_block_timeout(unsigned long ptr) | |||
4769 | struct lpfc_hba *phba = (struct lpfc_hba *) ptr; | 4766 | struct lpfc_hba *phba = (struct lpfc_hba *) ptr; |
4770 | unsigned long iflags; | 4767 | unsigned long iflags; |
4771 | uint32_t tmo_posted; | 4768 | uint32_t tmo_posted; |
4769 | |||
4772 | spin_lock_irqsave(&phba->pport->work_port_lock, iflags); | 4770 | spin_lock_irqsave(&phba->pport->work_port_lock, iflags); |
4773 | tmo_posted = phba->pport->work_port_events & WORKER_FABRIC_BLOCK_TMO; | 4771 | tmo_posted = phba->pport->work_port_events & WORKER_FABRIC_BLOCK_TMO; |
4774 | if (!tmo_posted) | 4772 | if (!tmo_posted) |
4775 | phba->pport->work_port_events |= WORKER_FABRIC_BLOCK_TMO; | 4773 | phba->pport->work_port_events |= WORKER_FABRIC_BLOCK_TMO; |
4776 | spin_unlock_irqrestore(&phba->pport->work_port_lock, iflags); | 4774 | spin_unlock_irqrestore(&phba->pport->work_port_lock, iflags); |
4777 | 4775 | ||
4778 | if (!tmo_posted) { | 4776 | if (!tmo_posted) |
4779 | spin_lock_irqsave(&phba->hbalock, iflags); | 4777 | lpfc_worker_wake_up(phba); |
4780 | if (phba->work_wait) | 4778 | return; |
4781 | lpfc_worker_wake_up(phba); | ||
4782 | spin_unlock_irqrestore(&phba->hbalock, iflags); | ||
4783 | } | ||
4784 | } | 4779 | } |
4785 | 4780 | ||
4786 | static void | 4781 | static void |