Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT

We shouldn't call smp_processor_id() in a preemptible
context, but this is advisory at best, so instead
call __smp_processor_id().

Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context")
Reported-by: Or Gerlitz <gerlitz.or@gmail.com>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Sagi Grimberg and committed by
Christoph Hellwig
ada83177 7a846656

+1 -1
+1 -1
drivers/nvme/host/tcp.c
··· 286 286 * directly, otherwise queue io_work. Also, only do that if we 287 287 * are on the same cpu, so we don't introduce contention. 288 288 */ 289 - if (queue->io_cpu == smp_processor_id() && 289 + if (queue->io_cpu == __smp_processor_id() && 290 290 sync && empty && mutex_trylock(&queue->send_mutex)) { 291 291 queue->more_requests = !last; 292 292 nvme_tcp_send_all(queue);