Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ext2FS+LibFileSystem: Make working with large files manageable #24998

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

implicitfield
Copy link
Contributor

See individual commits for details. The biggest change here is that we no longer store entire block lists in memory, since that can OOM way too easily. Instead, we now keep a 'view' to the actual block list, which can hold up to 10 000 blocks at once.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Sep 7, 2024
@BuggieBot
Copy link
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@implicitfield implicitfield force-pushed the ext2fs-cache branch 3 times, most recently from e68b5f4 to 581123a Compare September 8, 2024 07:40
For some context, write_bytes_locked used to simply bail out before
writing any data if there weren't enough blocks to cover the entire size
of an inode before 1bf7f99.

We're not actually restoring that behavior here, since computing the
amount of blocks to be allocated would get exceedingly complex,
considering that there could always be holes in between already
allocated blocks.

Instead, this simply makes allocate_blocks() bail out properly if there
aren't any free blocks left.

Fixes SerenityOS#24980
With this patch, we now only cache at most 10 000 blocks, which greatly
relieves memory pressure when working with large files.
This prevents us from running out of memory when copying large files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants