All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: "Moore, Eric" <Eric.Moore@lsi.com>
Cc: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Prakash, Sathya" <Sathya.Prakash@lsi.com>,
	"jejb@kernel.org" <jejb@kernel.org>
Subject: Re: [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible
Date: Tue, 17 Apr 2012 22:13:59 -0600	[thread overview]
Message-ID: <20120418041359.GB10862@parisc-linux.org> (raw)
In-Reply-To: <4565AEA676113A449269C2F3A549520FB5AE22E7@cosmail03.lsi.com>

On Tue, Apr 17, 2012 at 09:35:49PM -0600, Moore, Eric wrote:
>  Jan Schmidt suggested using raw_smp_processor_id()  back in February, see this: http://marc.info/?t=132974687100003&r=1&w=2
> 
> Alex Shi recently suggested using preempt_disable() and preempt_enable() to solve the same issue, see this: http://marc.info/?t=133274303900003&r=1&w=2
> 
> I believe the stack traces are there in both email discussion, they occur when CONFIG_DEBUG_PREEMPT is enabled.
> 
> I would rather go with the solution giving the best performance.   James Bottomley is there on the discussion with  Jan Schmidt, he suggested using get_cpu() and put_cpu().

I use get_cpu() / put_cpu() in the NVMe driver in similar circumstances.
It's not noticable in the profiles :-)

Where my usage differs from the patch for mpt2sas is that I hold a
reference to the CPU over the submission.  This works out well for
me because I have per-CPU state.  Might be worth considering for your
driver ...

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2012-04-18  4:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17  5:55 [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible nagalakshmi.nandigama
2012-04-18  3:14 ` Matthew Wilcox
2012-04-18  3:35   ` Moore, Eric
2012-04-18  4:13     ` Matthew Wilcox [this message]
2012-04-20 11:00       ` [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() inpreemptible Nandigama, Nagalakshmi
2012-04-23  1:29         ` Alex Shi
2012-04-20 11:07       ` [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible James Bottomley
2012-04-27 10:39 ` Nandigama, Nagalakshmi

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=20120418041359.GB10862@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=Eric.Moore@lsi.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sathya.Prakash@lsi.com \
    --cc=jejb@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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.