Re: [PATCH 4/4] scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>

Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux