mirror of
https://github.com/torvalds/linux
synced 2024-10-20 18:28:21 +00:00
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: db5ad6b7f8
("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>
This commit is contained in:
parent
7a84665619
commit
ada8317721
|
@ -286,7 +286,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
|
||||||
* directly, otherwise queue io_work. Also, only do that if we
|
* directly, otherwise queue io_work. Also, only do that if we
|
||||||
* are on the same cpu, so we don't introduce contention.
|
* are on the same cpu, so we don't introduce contention.
|
||||||
*/
|
*/
|
||||||
if (queue->io_cpu == smp_processor_id() &&
|
if (queue->io_cpu == __smp_processor_id() &&
|
||||||
sync && empty && mutex_trylock(&queue->send_mutex)) {
|
sync && empty && mutex_trylock(&queue->send_mutex)) {
|
||||||
queue->more_requests = !last;
|
queue->more_requests = !last;
|
||||||
nvme_tcp_send_all(queue);
|
nvme_tcp_send_all(queue);
|
||||||
|
|
Loading…
Reference in a new issue