Skip to content

fix: use vmalloc for temporary metadata segment buffers - #993

Merged
robertbaldyga merged 1 commit into
Open-CAS:masterfrom
Woart:fix/metadata-vmalloc
Nov 3, 2026
Merged

robertbaldyga merged 1 commit into
Open-CAS:masterfrom
Woart:fix/metadata-vmalloc

Conversation

@Woart

@Woart Woart commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace env_malloc() / env_free() with env_vmalloc() / env_vfree() for temporary metadata segment buffers.

The existing kmalloc() allocation can fail with ENOMEM under severe physical memory fragmentation, preventing Open CAS from loading cache metadata despite sufficient available RAM.

Temporary metadata copies do not require physically contiguous memory. The change also avoids unnecessary buffer zeroing.

Validation

Tested on Open CAS 26.09, Ubuntu 24.04, Linux 6.8.0-147-generic:

  • WT and WA cache modes
  • Successful cache Stop → Load recovery
  • 32/32 functional tests passed
  • Simulated SSD EIO and 200 ms latency
  • Cache eviction, concurrent I/O and SHA256 integrity verified

The fix follows the approach suggested by the maintainer in the related bug report.

Related issue: Open-CAS/open-cas-linux#1837

fix/metadata-vmalloc

Signed-off-by: Woart <46750383+Woart@users.noreply.github.com>
@Woart

Woart commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

I've submitted the fix as #993, using env_vmalloc() / env_vfree() as suggested.
The patch has passed our WT/WA functional and fault-injection tests.
Thank you for reviewing it!

@robertbaldyga
robertbaldyga merged commit 35b8ca5 into Open-CAS:master Nov 3, 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.

2 participants