* [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled
@ 2021-03-15 20:53 Sagi Grimberg
2021-03-15 21:15 ` Chaitanya Kulkarni
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sagi Grimberg @ 2021-03-15 20:53 UTC (permalink / raw)
To: linux-nvme, Christoph Hellwig, Keith Busch
For our pure advisory use-case, we only rely on this call as a hint
so fix the warning complaints of using the smp_processor_id variants
with preemption enabled.
Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context")
Fixes: ada831772188 ("nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/host/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index bd931de44d6c..0ef72568a4dd 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -287,7 +287,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
* directly, otherwise queue io_work. Also, only do that if we
* are on the same cpu, so we don't introduce contention.
*/
- if (queue->io_cpu == __smp_processor_id() &&
+ if (queue->io_cpu == raw_smp_processor_id() &&
sync && empty && mutex_trylock(&queue->send_mutex)) {
queue->more_requests = !last;
nvme_tcp_send_all(queue);
--
2.27.0
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled
2021-03-15 20:53 [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled Sagi Grimberg
@ 2021-03-15 21:15 ` Chaitanya Kulkarni
2021-03-16 2:47 ` Yi Zhang
2021-03-18 4:35 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-03-15 21:15 UTC (permalink / raw)
To: Sagi Grimberg, linux-nvme, Christoph Hellwig, Keith Busch
On 3/15/21 14:01, Sagi Grimberg wrote:
> For our pure advisory use-case, we only rely on this call as a hint
> so fix the warning complaints of using the smp_processor_id variants
> with preemption enabled.
>
> Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context")
> Fixes: ada831772188 ("nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
This patch adds the call that is discussed on the earlier thread.
Looks good.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled
2021-03-15 20:53 [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled Sagi Grimberg
2021-03-15 21:15 ` Chaitanya Kulkarni
@ 2021-03-16 2:47 ` Yi Zhang
2021-03-18 4:35 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Yi Zhang @ 2021-03-16 2:47 UTC (permalink / raw)
To: Sagi Grimberg, linux-nvme, Christoph Hellwig, Keith Busch
Thanks.
Tested-by: Yi Zhang <yi.zhang@redhat.com>
On 3/16/21 4:53 AM, Sagi Grimberg wrote:
> For our pure advisory use-case, we only rely on this call as a hint
> so fix the warning complaints of using the smp_processor_id variants
> with preemption enabled.
>
> Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context")
> Fixes: ada831772188 ("nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> drivers/nvme/host/tcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index bd931de44d6c..0ef72568a4dd 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -287,7 +287,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
> * directly, otherwise queue io_work. Also, only do that if we
> * are on the same cpu, so we don't introduce contention.
> */
> - if (queue->io_cpu == __smp_processor_id() &&
> + if (queue->io_cpu == raw_smp_processor_id() &&
> sync && empty && mutex_trylock(&queue->send_mutex)) {
> queue->more_requests = !last;
> nvme_tcp_send_all(queue);
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled
2021-03-15 20:53 [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled Sagi Grimberg
2021-03-15 21:15 ` Chaitanya Kulkarni
2021-03-16 2:47 ` Yi Zhang
@ 2021-03-18 4:35 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-03-18 4:35 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: linux-nvme, Christoph Hellwig, Keith Busch
Applied to nvme-5.12.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-18 4:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 20:53 [PATCH] nvme-tcp: Fix misuse of __smp_processor_id with preemption enabled Sagi Grimberg
2021-03-15 21:15 ` Chaitanya Kulkarni
2021-03-16 2:47 ` Yi Zhang
2021-03-18 4:35 ` Christoph Hellwig
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.