All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	GR-QLogic-Storage-Upstream@marvell.com,
	Hannes Reinecke <hare@suse.de>, Javed Hasan <jhasan@marvell.com>,
	Saurav Kashyap <skashyap@marvell.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 4/4] scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc().
Date: Fri, 6 May 2022 21:46:50 -0700	[thread overview]
Message-ID: <20220507044650.q3rcdi3mzlfvp37i@offworld> (raw)
In-Reply-To: <20220506105758.283887-5-bigeasy@linutronix.de>

On Fri, 06 May 2022, Sebastian Andrzej Siewior wrote:

>Using get_cpu() leads to disabling preemption and in this context it is
>not possible to acquire the following spinlock_t on PREEMPT_RT because
>it becomes a sleeping lock.
>
>Commit
>   0ea5c27583e1c ("[SCSI] bnx2fc: common free list for cleanup commands")
>
>says that it is using get_cpu() as a fix in case the CPU is preempted.
>While this might be true, the important part is that it is now using the
>same CPU for locking and unlocking while previously it always relied on
>smp_processor_id().
>The date structure itself is protected with a lock so it does not rely
>on CPU-local access.
>
>Replace get_cpu() with raw_smp_processor_id() to obtain the current CPU
>number which is used as an index for the per-CPU resource.
>
>Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>

  reply	other threads:[~2022-05-07  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 10:57 [PATCH 0/4] scsi: PREEMPT_RT related fixes Sebastian Andrzej Siewior
2022-05-06 10:57 ` [PATCH 1/4] scsi: fcoe: Add a local_lock to fcoe_percpu Sebastian Andrzej Siewior
2022-05-06 10:57 ` [PATCH 2/4] scsi: fcoe: Use per-CPU API to update per-CPU statistics Sebastian Andrzej Siewior
2022-05-10  0:48   ` Davidlohr Bueso
2022-05-06 10:57 ` [PATCH 3/4] scsi: libfc: Remove get_cpu() semantics in fc_exch_em_alloc() Sebastian Andrzej Siewior
2022-05-06 10:57 ` [PATCH 4/4] scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc() Sebastian Andrzej Siewior
2022-05-07  4:46   ` Davidlohr Bueso [this message]
2022-05-17  1:28 ` [PATCH 0/4] scsi: PREEMPT_RT related fixes Martin K. Petersen
2022-05-17  6:11   ` Sebastian Andrzej Siewior
2022-05-20  1:09 ` Martin K. Petersen

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=20220507044650.q3rcdi3mzlfvp37i@offworld \
    --to=dave@stgolabs.net \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=bigeasy@linutronix.de \
    --cc=dbueso@suse.de \
    --cc=hare@suse.de \
    --cc=jejb@linux.ibm.com \
    --cc=jhasan@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=skashyap@marvell.com \
    --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 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.