From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Saxena, Sumit" <Sumit.Saxena@lsi.com>
Cc: Wei Yongjun <weiyj.lk@gmail.com>,
DL-MegaRAID Linux <megaraidlinux@lsi.com>,
"simon.puels@gmail.com" <simon.puels@gmail.com>,
"jkosina@suse.cz" <jkosina@suse.cz>,
"yongjun_wei@trendmicro.com.cn" <yongjun_wei@trendmicro.com.cn>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] [SCSI] megaraid: use GFP_ATOMIC under spin lock
Date: Thu, 13 Mar 2014 14:29:53 +0400 [thread overview]
Message-ID: <1394706593.2192.13.camel@dabdike> (raw)
In-Reply-To: <811b9a4297a34f07be49db76acb84afb@DM2PR07MB400.namprd07.prod.outlook.com>
On Wed, 2014-01-08 at 12:16 +0000, Saxena, Sumit wrote:
>
> >-----Original Message-----
> >From: Wei Yongjun [mailto:weiyj.lk@gmail.com]
> >Sent: Friday, December 20, 2013 8:38 AM
> >To: DL-MegaRAID Linux; JBottomley@parallels.com; simon.puels@gmail.com;
> >jkosina@suse.cz
> >Cc: yongjun_wei@trendmicro.com.cn; linux-scsi@vger.kernel.org
> >Subject: [PATCH] [SCSI] megaraid: use GFP_ATOMIC under spin lock
> >
> >From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> >A spin lock is taken here so we should use GFP_ATOMIC.
> >
> >Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >---
> > drivers/scsi/megaraid/megaraid_mm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/scsi/megaraid/megaraid_mm.c
> >b/drivers/scsi/megaraid/megaraid_mm.c
> >index a706927..99fa5d3 100644
> >--- a/drivers/scsi/megaraid/megaraid_mm.c
> >+++ b/drivers/scsi/megaraid/megaraid_mm.c
> >@@ -570,7 +570,7 @@ mraid_mm_attach_buf(mraid_mmadp_t *adp, uioc_t
> >*kioc, int xferlen)
> >
> > kioc->pool_index = right_pool;
> > kioc->free_buf = 1;
> >- kioc->buf_vaddr = pci_pool_alloc(pool->handle, GFP_KERNEL,
> >+ kioc->buf_vaddr = pci_pool_alloc(pool->handle,
> >GFP_ATOMIC,
> > &kioc->buf_paddr);
> > spin_unlock_irqrestore(&pool->lock, flags);
> >
> >
> Acked-by: Sumit Saxena <sumit.saxena@lsi.com>
This doesn't look like the right fix to me. What is the function of
pool->lock around this code region? The only data you use from the pool
is pool->handle which is set up at init time ... there's no need to use
a lock to read a piece of data which is effectively constant, so just
drop the lock.
James
next prev parent reply other threads:[~2014-03-13 14:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 3:08 [PATCH] [SCSI] megaraid: use GFP_ATOMIC under spin lock Wei Yongjun
2014-01-08 12:16 ` Saxena, Sumit
2014-03-13 10:29 ` James Bottomley [this message]
2014-03-19 7:21 ` Desai, Kashyap
2014-03-19 15:21 ` James Bottomley
2014-03-25 15:36 ` Desai, Kashyap
-- strict thread matches above, loose matches on Subject: below --
2012-11-17 15:08 [patch] [SCSI] MegaRAID: " Dan Carpenter
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=1394706593.2192.13.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=Sumit.Saxena@lsi.com \
--cc=jkosina@suse.cz \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux@lsi.com \
--cc=simon.puels@gmail.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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