Occasional kernel error with NVMe-oF TCP target

Sagi Grimberg sagi at grimberg.me
Sun Aug 25 02:02:14 PDT 2024




On 21/08/2024 20:13, Jonas Konrad wrote:
> It's the default, 20.
>
> The machine has 192G memory, of which only roughly half is 
> used/shared/buffers. However a lot of memory is used by ZFS cache, 
> which may impact things. Next time this bug happens I'll try to get 
> some form of memory dump.

We really should not be allocating this much contiguous memory.
I think that the below change is also appropriate:
--
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 5bff0d5464d1..010b8da2d2e6 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -1516,7 +1516,7 @@ static int nvmet_tcp_alloc_cmds(struct 
nvmet_tcp_queue *queue)
         struct nvmet_tcp_cmd *cmds;
         int i, ret = -EINVAL, nr_cmds = queue->nr_cmds;

-       cmds = kcalloc(nr_cmds, sizeof(struct nvmet_tcp_cmd), GFP_KERNEL);
+       cmds = kvcalloc(nr_cmds, sizeof(struct nvmet_tcp_cmd), GFP_KERNEL);
         if (!cmds)
                 goto out;
--



More information about the Linux-nvme mailing list