Skip to content

req: Use kvzalloc() for allocating request map - #977

Merged
robertbaldyga merged 1 commit into
Open-CAS:masterfrom
robertbaldyga:req-kvzalloc
Sep 27, 2026
Merged

robertbaldyga merged 1 commit into
Open-CAS:masterfrom
robertbaldyga:req-kvzalloc

Conversation

@robertbaldyga

Copy link
Copy Markdown
Member

For a large requests (several MiB and up) zalloc() has a huge chance to fail if the system memory is fragmented, causing I/O error. Prevent this error by using kvzalloc(), which internally first attempts zalloc(), and it it fails, falls back to vzmalloc(). For requests of that size the latency of the I/O itself is large enough for additional vmalloc allocation to not matter anyway, and for small requests we still have fast mempool/kmalloc path with a fallback.

For a large requests (several MiB and up) zalloc() has a huge chance to
fail if the system memory is fragmented, causing I/O error.
Prevent this error by using kvzalloc(), which internally first attempts
zalloc(), and it it fails, falls back to vzmalloc().
For requests of that size the latency of the I/O itself is large enough
for additional vmalloc allocation to not matter anyway, and for small
requests we still have fast mempool/kmalloc path with a fallback.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
@robertbaldyga
robertbaldyga merged commit aff886f into Open-CAS:master Sep 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant