Skip to content

btrfs: remove __GFP_NOFAIL usage for debug builds

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: do not use __GFP_NOFAIL flag for __alloc_extent_buffer()fs/btrfs/extent_io.c+5 -10 replies
2/3btrfs: do not use __GFP_NOFAIL flag for attach_eb_folio_to_filemap()fs/btrfs/extent_io.c+8 -10 replies
3/3btrfs: do not use __GFP_NOFAIL flag for btrfs_alloc_folio_array()fs/btrfs/extent_io.c+2 -10 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/3] btrfs: remove __GFP_NOFAIL usage for debug builds

This patchset removes all __GFP_NOFAIL flags usage inside btrfs for DEBUG builds.

There are 3 call sites utilizing __GFP_NOFAIL:

- __alloc_extent_buffer()
It's for the extent_buffer structure allocation. All callers are already handling the errors.

- attach_eb_folio_to_filemap()
It's for the filemap_add_folio() call, the flag is also passed to mem cgroup, which I suspect is not handling larger folio and __GFP_NOFAIL correctly, as I'm hitting soft lockups when testing larger folios

New error handling is added.

- btrfs_alloc_folio_array()
This is for page allocation for extent buffers.
All callers are already handling the errors.

Furthermore, to enable more testing while not affecting end users, the change is only implemented for DEBUG builds.

Qu Wenruo (3):
btrfs: do not use __GFP_NOFAIL flag for __alloc_extent_buffer()
btrfs: do not use __GFP_NOFAIL flag for attach_eb_folio_to_filemap()
btrfs: do not use __GFP_NOFAIL flag for btrfs_alloc_folio_array()

 fs/btrfs/extent_io.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
Signature · 1 line
2.45.2