Skip to content

btrfs: Don't block system suspend during fstrim

Luca Stefani linux-btrfs lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 9 repliesIn review
  2. v52 patches 3 repliesSuperseded
  3. v43 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v33 patches6 repliesSuperseded
v11 patch1 replySuperseded

Changes in v6 from the cover letter

* Make chunk size a define
* Remove superfluous trim_interrupted checks after moving them to trim_no_bitmap/trim_bitmaps

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: Split remaining space to discard in chunksfs/btrfs/extent-tree.c fs/btrfs/volumes.h+16 -40 replies
2/2btrfs: Don't block system suspend during fstrimfs/btrfs/extent-tree.c fs/btrfs/free-space-cache.c fs/btrfs/free-space-cache.h+14 -35 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchQu Wenruo
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/2] btrfs: Don't block system suspend during fstrim

Changes since v5:
* Make chunk size a define
* Remove superfluous trim_interrupted checks after moving them to trim_no_bitmap/trim_bitmaps

Changes since v4:
* Set chunk size to 1G
* Set proper error return codes in case of interruption
* Dropped fstrim_range fixup as pulled in -next

Changes since v3:
* Went back to manual chunk size

Changes since v2:
* Use blk_alloc_discard_bio directly
* Reset ret to ERESTARTSYS

Changes since v1:
* Use bio_discard_limit to calculate chunk size
* Makes use of the split chunks

Original discussion: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v3: https://lore.kernel.org/lkml/[email protected]/
v4: https://lore.kernel.org/lkml/[email protected]/
v5: https://lore.kernel.org/lkml/[email protected]/

---

NB: I didn't change btrfs_discard_workfn yet to add error checks as I don't know what semantics we should have in that case. The work queue is always re-scheduled and created with WQ_FREEZABLE so it should be automatically frozen. Shall I simply add some logs?

---

Luca Stefani (2):
btrfs: Split remaining space to discard in chunks
btrfs: Don't block system suspend during fstrim

 fs/btrfs/extent-tree.c      | 26 +++++++++++++++++++++-----
 fs/btrfs/free-space-cache.c |  4 ++--
 fs/btrfs/free-space-cache.h |  6 ++++++
 fs/btrfs/volumes.h          |  1 +
 4 files changed, 30 insertions(+), 7 deletions(-)
Signature · 1 line
2.46.0