mbox series

[0/3] few mm helpers for bcachefs

Message ID 20240206215016.961253-1-kent.overstreet@linux.dev (mailing list archive)
Headers show
Series few mm helpers for bcachefs | expand

Message

Kent Overstreet Feb. 6, 2024, 9:50 p.m. UTC
memalloc_flags_{save,restore} - cleanup of the existing duplication in
our memalloc_*_{save,restore} functions

PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN: we've been talking about
getting away from gfp flags for years, but we've been lacking some
PF_MEMALLOC_* equivalents that we need to make that happen - this adds
some of the missing ones.

they're needed for calling alloc_inode() in bcachefs with btree locks
held (so that we can make lookup() properly transactional), since it
doesn't take a gfp flags param and adding it would require changing
methods in every fs.

Kent Overstreet (3):
  mm: introduce memalloc_flags_{save,restore}
  mm: introduce PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN
  mempool: kvmalloc pool

 include/linux/mempool.h  | 13 +++++++++
 include/linux/sched.h    |  4 +--
 include/linux/sched/mm.h | 60 ++++++++++++++++++++++++++--------------
 mm/mempool.c             | 13 +++++++++
 4 files changed, 67 insertions(+), 23 deletions(-)