From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Carsten Emde <C.Emde@osadl.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
John Kacur <jkacur@redhat.com>, <stable-rt@vger.kernel.org>,
Stephen <scameron@beardog.cce.hp.com>
Subject: [PATCH RT 03/10] hpsa: fix warning with smp_processor_id() in preemptible section
Date: Sun, 08 Sep 2013 08:25:48 -0400 [thread overview]
Message-ID: <20130908122700.069493932@goodmis.org> (raw)
In-Reply-To: 20130908122545.421180629@goodmis.org
[-- Attachment #1: 0003-hpsa-fix-warning-with-smp_processor_id-in-preemptibl.patch --]
[-- Type: text/plain, Size: 3376 bytes --]
From: John Kacur <jkacur@redhat.com>
On a 3.6-rt (real-time patch) kernel we are seeing the following BUG
However, it appears to be relevant for non-realtime (mainline) as well.
|hpsa 0000:03:00.0: hpsa0: <0x323a> at IRQ 67 using DAC
|scsi0 : hpsa
|BUG: using smp_processor_id() in preemptible [0000000000000000] code: kworker/u:0/6
|caller is enqueue_cmd_and_start_io+0x5a/0x100 [hpsa]
|Pid: 6, comm: kworker/u:0 Not tainted 3.6.11.5-rt37.52.el6rt.x86_64.debug #1
|Call Trace:
| [<ffffffff812abe83>] debug_smp_processor_id+0x123/0x150
| [<ffffffffa009043a>] enqueue_cmd_and_start_io+0x5a/0x100 [hpsa]
| [<ffffffffa00905cb>] hpsa_scsi_do_simple_cmd_core+0xeb/0x110 [hpsa]
| [<ffffffff812b09c8>] ? swiotlb_dma_mapping_error+0x18/0x30
| [<ffffffff812b09c8>] ? swiotlb_dma_mapping_error+0x18/0x30
| [<ffffffffa0090701>] hpsa_scsi_do_simple_cmd_with_retry+0x91/0x280 [hpsa]
| [<ffffffffa0093558>] hpsa_scsi_do_report_luns.clone.2+0xd8/0x130 [hpsa]
| [<ffffffffa00935ea>] hpsa_gather_lun_info.clone.3+0x3a/0x1a0 [hpsa]
| [<ffffffffa00963df>] hpsa_update_scsi_devices+0x11f/0x4f0 [hpsa]
| [<ffffffff81592019>] ? sub_preempt_count+0xa9/0xe0
| [<ffffffffa00968ad>] hpsa_scan_start+0xfd/0x150 [hpsa]
| [<ffffffff8158cba8>] ? rt_spin_lock_slowunlock+0x78/0x90
| [<ffffffff813b04d7>] do_scsi_scan_host+0x37/0xa0
| [<ffffffff813b05da>] do_scan_async+0x1a/0x30
| [<ffffffff8107c4ab>] async_run_entry_fn+0x9b/0x1d0
| [<ffffffff8106ae92>] process_one_work+0x1f2/0x620
| [<ffffffff8106ae20>] ? process_one_work+0x180/0x620
| [<ffffffff8106d4fe>] ? worker_thread+0x5e/0x3a0
| [<ffffffff8107c410>] ? async_schedule+0x20/0x20
| [<ffffffff8106d5d3>] worker_thread+0x133/0x3a0
| [<ffffffff8106d4a0>] ? manage_workers+0x190/0x190
| [<ffffffff81073236>] kthread+0xa6/0xb0
| [<ffffffff815970a4>] kernel_thread_helper+0x4/0x10
| [<ffffffff81082a7c>] ? finish_task_switch+0x8c/0x110
| [<ffffffff8158e44b>] ? _raw_spin_unlock_irq+0x3b/0x70
| [<ffffffff8158e85d>] ? retint_restore_args+0xe/0xe
| [<ffffffff81073190>] ? kthreadd+0x1e0/0x1e0
| [<ffffffff815970a0>] ? gs_change+0xb/0xb
-------------------
This is caused by
enqueue_cmd_and_start_io()->
set_performant_mode()->
smp_processor_id()
Which if you have debugging enabled calls debug_processor_id() and triggers the warning.
The code here is
c->Header.ReplyQueue = smp_processor_id() % h->nreply_queues;
Since it is not critical that the code complete on the same processor,
but the cpu is a hint used in generating the ReplyQueue and will still work if
the cpu migrates or is preempted, it is safe to use the raw_smp_processor_id()
to surpress the false positve warning.
Cc: stable-rt@vger.kernel.org
Signed-off-by: John Kacur <jkacur@redhat.com>
Acked-by: Stephen <scameron@beardog.cce.hp.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/scsi/hpsa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 4f33806..80a44b1 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -583,7 +583,7 @@ static void set_performant_mode(struct ctlr_info *h, struct CommandList *c)
c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1);
if (likely(h->msix_vector))
c->Header.ReplyQueue =
- smp_processor_id() % h->nreply_queues;
+ raw_smp_processor_id() % h->nreply_queues;
}
}
--
1.7.10.4
next prev parent reply other threads:[~2013-09-08 12:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 12:25 [PATCH RT 00/10] 3.8.13-rt16-rc1 stable review Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 01/10] sched: Distangle worker accounting from rqlock Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 02/10] rt,ntp: Move call to schedule_delayed_work() to helper thread Steven Rostedt
2013-09-08 12:25 ` Steven Rostedt [this message]
2013-09-08 12:25 ` [PATCH RT 04/10] powerpc: 52xx: provide a default in mpc52xx_irqhost_map() Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 05/10] hwlat-detector: Update hwlat_detector to add outer loop detection Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 06/10] hwlat-detect/trace: Export trace_clock_local for hwlat-detector Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 07/10] hwlat-detector: Use trace_clock_local if available Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 08/10] hwlat-detector: Use thread instead of stop machine Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 09/10] genirq: do not invoke the affinity callback via a workqueue Steven Rostedt
2013-09-08 12:25 ` [PATCH RT 10/10] Linux 3.8.13-rt16-rc1 Steven Rostedt
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=20130908122700.069493932@goodmis.org \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=bigeasy@linutronix.de \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=scameron@beardog.cce.hp.com \
--cc=stable-rt@vger.kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).