]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: libfc: Remove get_cpu() semantics in fc_exch_em_alloc()
authorDavidlohr Bueso <dave@stgolabs.net>
Fri, 6 May 2022 10:57:57 +0000 (12:57 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 17 May 2022 01:26:50 +0000 (21:26 -0400)
commit6b7a410ee261755b52bf67f984633c220351dba4
tree0ccd5eada0dce07d91c4912b139f01d8e0e96d47
parent5fe458cee24c05528eaf207f4e1f8bfb26b2dbdc
scsi: libfc: Remove get_cpu() semantics in fc_exch_em_alloc()

The get_cpu() in fc_exch_em_alloc() was introduced in commit 9c58f277f90b
("[SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt
disabled") for no other reason than to simply use smp_processor_id()
without getting a warning, because everything is done with the pool->lock
held anyway.  However, get_cpu(), by disabling preemption, does not play
well with PREEMPT_RT, particularly when acquiring a regular (and thus
sleepable) spinlock.

Therefore remove the get_cpu() and just use the unstable value as we will
have CPU locality guarantees next by taking the lock.  The window of
migration, as noted by Sebastian, is small and even if it happens the
result is correct.

Link: https://lore.kernel.org/r/20211117025956.79616-2-dave@stgolabs.net
Link: https://lore.kernel.org/r/20220506105758.283887-4-bigeasy@linutronix.de
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_exch.c