[PATCH] nvme-tcp: fix usage of page_frag_cache
Keith Busch
kbusch at kernel.org
Mon Aug 10 16:40:21 PDT 2026
On Thu, Jul 16, 2026 at 04:42:19PM +0200, Daniel Wagner wrote:
> From: Dmitry Bogdanov <d.bogdanov at yadro.com>
>
> nvme uses page_frag_cache to preallocate PDU for each preallocated request
> of block device. Block devices are created in parallel threads,
> consequently page_frag_cache is used in not thread-safe manner.
> That leads to incorrect refcounting of backstore pages and premature free.
I was struggling to see how the nvme_tcp callback was happening
concurrently for the same queue. It's because you're using an io
scheduler, right? I don't think this applies if you don't have one
enabled.
Anyway, with that understanding, looks like a safe patch. Applied to
nvme-7.3.
More information about the Linux-nvme
mailing list