linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fuse: remove extra page copies in writeback
@ 2024-10-14 18:22 Joanne Koong
  2024-10-14 18:22 ` [PATCH v2 1/2] mm: skip reclaiming folios in writeback contexts that may trigger deadlock Joanne Koong
  2024-10-14 18:22 ` [PATCH v2 2/2] fuse: remove tmp folio for writebacks and internal rb tree Joanne Koong
  0 siblings, 2 replies; 63+ messages in thread
From: Joanne Koong @ 2024-10-14 18:22 UTC (permalink / raw)
  To: miklos, linux-fsdevel
  Cc: josef, bernd.schubert, jefflexu, hannes, shakeel.butt, linux-mm,
	kernel-team

Currently when we handle writeback in fuse, we allocate and copy data
to a temporary folio in order to mitigate the following deadlock scenario
that may arise if reclaim waits on writeback to complete:
* single-threaded FUSE server is in the middle of handling a request
  that needs a memory allocation
* memory allocation triggers direct reclaim
* direct reclaim waits on a folio under writeback
* the FUSE server can't write back the folio since it's stuck in
  direct reclaim
(more details can be found here [1])

The first patch adds a AS_NO_WRITEBACK_RECLAIM flag to "enum mapping_flags"
to indicate that reclaim when in writeback should be skipped for filesystems
with this flag set. More details can be found in the commit message of the
first patch, but this only actually affects the case of legacy cgroupv1 when
it encounters a folio that already has the reclaim flag set (in the other
cases, we already skip reclaim when in writeback). Doing so allows us to
get rid of needing to allocate and copy over pages to a temporary folio when
handling writeback in fuse (2nd patch). Benchmarks can be found in commit
message of the 2nd patch.

Thanks,
Joanne

[1] https://lore.kernel.org/linux-kernel/495d2400-1d96-4924-99d3-8b2952e05fc3@linux.alibaba.com/

v1: https://lore.kernel.org/linux-fsdevel/20241011223434.1307300-1-joannelkoong@gmail.com/T/#t
Changes from v1 -> v2:
* Have flag in "enum mapping_flags" instead of creating asop_flags (Shakeel)
* Set fuse inodes to use AS_NO_WRITEBACK_RECLAIM (Shakeel)

Joanne Koong (2):
  mm: skip reclaiming folios in writeback contexts that may trigger
    deadlock
  fuse: remove tmp folio for writebacks and internal rb tree

 fs/fuse/file.c          | 322 ++++------------------------------------
 include/linux/pagemap.h |  11 ++
 mm/vmscan.c             |   6 +-
 3 files changed, 43 insertions(+), 296 deletions(-)

-- 
2.43.5



^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2024-11-06 23:56 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 18:22 [PATCH v2 0/2] fuse: remove extra page copies in writeback Joanne Koong
2024-10-14 18:22 ` [PATCH v2 1/2] mm: skip reclaiming folios in writeback contexts that may trigger deadlock Joanne Koong
2024-10-14 18:38   ` Shakeel Butt
2024-10-14 21:04     ` Joanne Koong
2024-10-14 23:57       ` Shakeel Butt
2024-10-15 16:59         ` Joanne Koong
2024-10-14 18:22 ` [PATCH v2 2/2] fuse: remove tmp folio for writebacks and internal rb tree Joanne Koong
2024-10-15 10:01   ` Miklos Szeredi
2024-10-15 17:06     ` Joanne Koong
2024-10-15 19:17       ` Shakeel Butt
2024-10-16  9:44         ` Jingbo Xu
2024-10-16  9:57           ` Miklos Szeredi
2024-10-16  9:51         ` Miklos Szeredi
2024-10-16 17:52           ` Shakeel Butt
2024-10-16 18:37             ` Miklos Szeredi
2024-10-16 21:27               ` Shakeel Butt
2024-10-17 13:31                 ` Miklos Szeredi
2024-10-18  5:31                   ` Shakeel Butt
2024-10-21 10:15                     ` Miklos Szeredi
2024-10-21 17:01                       ` Shakeel Butt
2024-10-22 15:03                         ` Miklos Szeredi
2024-10-21 21:05                       ` Joanne Koong
2024-10-24 16:54                         ` Joanne Koong
2024-10-25  1:38                           ` Jingbo Xu
2024-10-25 15:32                             ` Miklos Szeredi
2024-10-25 17:36                             ` Joanne Koong
2024-10-25 18:02                               ` Miklos Szeredi
2024-10-25 18:19                                 ` Joanne Koong
2024-10-28  2:02                                   ` Jingbo Xu
2024-10-25 18:47                               ` Joanne Koong
2024-10-28  2:28                                 ` Jingbo Xu
2024-10-28 21:57                                   ` Joanne Koong
2024-10-25 22:40                               ` Joanne Koong
2024-10-28 21:58                                 ` Joanne Koong
2024-10-30  9:32                                   ` Bernd Schubert
2024-10-30 16:04                                     ` Joanne Koong
2024-10-30 16:21                                       ` Bernd Schubert
2024-10-30 17:02                                         ` Joanne Koong
2024-10-30 17:27                                           ` Bernd Schubert
2024-10-30 17:35                                             ` Joanne Koong
2024-10-30 21:56                                               ` Shakeel Butt
2024-10-30 22:17                                                 ` Bernd Schubert
2024-10-30 22:51                                                   ` Joanne Koong
2024-10-31  0:30                                                     ` Shakeel Butt
2024-10-31 19:06                                                       ` Joanne Koong
2024-10-31 20:06                                                         ` Shakeel Butt
2024-10-31 21:52                                                           ` Joanne Koong
2024-10-31 22:38                                                             ` Shakeel Butt
2024-11-06 23:37                                                               ` Joanne Koong
2024-11-06 23:56                                                                 ` Shakeel Butt
2024-11-01 11:44                                                             ` Jingbo Xu
2024-11-01 20:54                                                               ` Joanne Koong
2024-11-04  8:09                                                                 ` Jingbo Xu
2024-10-29 22:04                   ` Bernd Schubert
2024-10-16  9:56     ` Jingbo Xu
2024-10-16 10:00       ` Miklos Szeredi
2024-10-18  1:30     ` Joanne Koong
2024-10-18  5:57       ` Shakeel Butt
2024-10-18 19:57         ` Joanne Koong
2024-10-18 20:46           ` Shakeel Butt
2024-10-21  9:32       ` Miklos Szeredi
2024-10-18  9:24   ` Jingbo Xu
2024-10-18 20:29     ` Joanne Koong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).