linux-stable/fs/gfs2
Andreas Gruenbacher be9ce0dbde gfs2: low-memory forced flush fixes
[ Upstream commit b74cd55aa9 ]

First, function gfs2_ail_flush_reqd checks the SDF_FORCE_AIL_FLUSH flag
to determine if an AIL flush should be forced in low-memory situations.
However, it also immediately clears the flag, and when called repeatedly
as in function gfs2_logd, the flag will be lost.  Fix that by pulling
the SDF_FORCE_AIL_FLUSH flag check out of gfs2_ail_flush_reqd.

Second, function gfs2_writepages sets the SDF_FORCE_AIL_FLUSH flag
whether or not enough pages were written.  If enough pages could be
written, flushing the AIL is unnecessary, though.

Third, gfs2_writepages doesn't wake up logd after setting the
SDF_FORCE_AIL_FLUSH flag, so it can take a long time for logd to react.
It would be preferable to wake up logd, but that hurts the performance
of some workloads and we don't quite understand why so far, so don't
wake up logd so far.

Fixes: b066a4eebd ("gfs2: forcibly flush ail to relieve memory pressure")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:22:56 +02:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
aops.c gfs2: low-memory forced flush fixes 2023-09-19 12:22:56 +02:00
aops.h
bmap.c gfs2: Always check inode size of inline inodes 2023-02-09 11:26:48 +01:00
bmap.h
dentry.c
dir.c
dir.h
export.c
file.c gfs2: Fix gfs2_file_buffered_write endless loop workaround 2022-07-12 16:34:59 +02:00
gfs2.h
glock.c gfs2: Introduce flag for glock holder auto-demotion 2022-05-01 17:22:30 +02:00
glock.h gfs2: Introduce flag for glock holder auto-demotion 2022-05-01 17:22:30 +02:00
glops.c gfs2: Fix inode height consistency check 2023-05-24 17:36:45 +01:00
glops.h
incore.h gfs2: Eliminate ip->i_gh 2022-05-01 17:22:30 +02:00
inode.c gfs2: gfs2_setattr_size error path fix 2022-04-08 14:24:10 +02:00
inode.h
Kconfig
lock_dlm.c gfs2: Don't call dlm after protocol is unmounted 2021-08-20 09:03:46 -05:00
log.c gfs2: low-memory forced flush fixes 2023-09-19 12:22:56 +02:00
log.h
lops.c gfs2: be more verbose replaying invalid rgrp blocks 2021-08-19 12:31:17 -05:00
lops.h
main.c
Makefile
meta_io.c gfs2: don't stop reads while withdraw in progress 2021-08-20 09:03:46 -05:00
meta_io.h
ops_fstype.c gfs2: Switch from strlcpy to strscpy 2022-11-26 09:24:51 +01:00
quota.c gfs2: use i_lock spin_lock for inode qadata 2022-06-09 10:22:40 +02:00
quota.h
recovery.c
recovery.h
rgrp.c gfs2: assign rgrp glock before compute_bitstructs 2022-04-27 14:38:51 +02:00
rgrp.h gfs2: gfs2_setattr_size error path fix 2022-04-08 14:24:10 +02:00
super.c gfs2: Fix possible data races in gfs2_show_options() 2023-08-26 14:23:24 +02:00
super.h gfs2: Don't release and reacquire local statfs bh 2021-08-20 09:03:46 -05:00
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c gfs2: Mark journal inodes as "don't cache" 2021-08-20 09:03:46 -05:00
util.h gfs2: don't stop reads while withdraw in progress 2021-08-20 09:03:46 -05:00
xattr.c
xattr.h