[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170124120238.GB3609@linux-x5ow.site>
Date: Tue, 24 Jan 2017 13:02:38 +0100
From: Johannes Thumshirn <jthumshirn@...e.de>
To: Chaitra P B <chaitra.basappa@...adcom.com>
Cc: JBottomley@...allels.com, jejb@...nel.org, hch@...radead.org,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
Sathya.Prakash@...adcom.com, kashyap.desai@...adcom.com,
krishnaraddi.mankani@...adcom.com, linux-kernel@...r.kernel.org,
suganath-prabu.subramani@...adcom.com, sreekanth.reddy@...adcom.com
Subject: Re: [PATCH v3 2/4] mpt3sas: Fix for Crusader to achieve product
targets with SAS devices.
On Mon, Jan 23, 2017 at 03:26:08PM +0530, Chaitra P B wrote:
> Small glitch/degraded performance in Crusader is improved with SAS
> drives by removing unnecessary spinlocks while clearing scsi command
> in drivers internal lookup table.
>
> Signed-off-by: Chaitra P B <chaitra.basappa@...adcom.com>
> Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@...adcom.com>
> ---
> drivers/scsi/mpt3sas/mpt3sas_base.c | 1 +
> drivers/scsi/mpt3sas/mpt3sas_base.h | 1 +
> drivers/scsi/mpt3sas/mpt3sas_ctl.c | 4 +++-
> drivers/scsi/mpt3sas/mpt3sas_scsih.c | 31 ++++++++++++++++++++++++++++---
> 4 files changed, 33 insertions(+), 4 deletions(-)
[...]
> + * __scsih_scsi_lookup_get_clear - returns scmd entry without
> + * holding any lock.
> + * @ioc: per adapter object
> + * @smid: system request message index
> + *
> + * Returns the smid stored scmd pointer.
> + * Then will dereference the stored scmd pointer.
> + */
> +static inline struct scsi_cmnd *
> +__scsih_scsi_lookup_get_clear(struct MPT3SAS_ADAPTER *ioc,
> + u16 smid)
> +{
> + struct scsi_cmnd *scmd = NULL;
> +
> + swap(scmd, ioc->scsi_lookup[smid - 1].scmd);
> +
> + return scmd;
> +}
> +
> +/**
> * _scsih_scsi_lookup_get_clear - returns scmd entry
That's only 50% of what I've meant:
static inline struct scsi_cmnd *
_scsih_scsi_lookup_get_clear(struct MPT3SAS_ADAPTER *ioc, u16 smid)
{
unsigned long flags;
struct scsi_cmnd *scmnd;
spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
- scmd = ioc->scsi_lookup[smid - 1].scmd;
- ioc->scsi_lookup[smid - 1].scmd = NULL;
+ scmnd = __scsih_scsi_lookup_get_clear(ioc, smid);
spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
return scmnd;
}
[...]
Byte,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@...e.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Powered by blists - more mailing lists