Skip to content

Improve compression workspaces memory management

David Sterba linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: rename and document compression workspace membersfs/btrfs/compression.c+19 -160 replies
2/4btrfs: preallocate compression workspacesfs/btrfs/compression.c+16 -00 replies
3/4btrfs: make find_workspace always succeedfs/btrfs/compression.c+12 -80 replies
4/4btrfs: make find_workspace warn if there are no workspacesfs/btrfs/compression.c+14 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Improve compression workspaces memory management

Hi,

the compression workspaces are allocated as needed an this could fail if there's no free memory. Moreover, as we might be flushing data from the restricted contexts we should try our best not to fail.

This patchset preallocates one workspace for each compression type at module load time (and tries to get one if that fails later). If any further request for new workspace fails, there's still that one to make progress. IOW workspace allocation will not fail at writeback time.

I have tested this by instrumenting the code to limit the number of workspaces to one and did some stress tests.

David Sterba (4):
btrfs: rename and document compression workspace members
btrfs: preallocate compression workspaces
btrfs: make find_workspace always succeed
btrfs: make find_workspace warn if there are no workspaces

 fs/btrfs/compression.c | 85 ++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 61 insertions(+), 24 deletions(-)
Signature · 1 line
2.7.1