Skip to content
Snippets Groups Projects
Commit cde90210 authored by Brian Foster's avatar Brian Foster
Browse files

ext4: fallback to complex scan if aligned scan doesn't work

JIRA: https://issues.redhat.com/browse/RHEL-83284


Conflicts: Work around allocation criteria logic difference and lack
	of macros in RHEL9.

commit 1f6bc02f18489b9c9ea39b068d0695fb0e4567e9
Author: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Date:   Fri Dec 15 16:49:50 2023 +0530

    ext4: fallback to complex scan if aligned scan doesn't work

    Currently in case the goal length is a multiple of stripe size we use
    ext4_mb_scan_aligned() to find the stripe size aligned physical blocks.
    In case we are not able to find any, we again go back to calling
    ext4_mb_choose_next_group() to search for a different suitable block
    group. However, since the linear search always begins from the start,
    most of the times we end up with the same BG and the cycle continues.

    With large fliesystems, the CPU can be stuck in this loop for hours
    which can slow down the whole system. Hence, until we figure out a
    better way to continue the search (rather than starting from beginning)
    in ext4_mb_choose_next_group(), lets just fallback to
    ext4_mb_complex_scan_group() in case aligned scan fails, as it is much
    more likely to find the needed blocks.

Signed-off-by: default avatarOjaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/ee033f6dfa0a7f2934437008a909c3788233950f.1702455010.git.ojaswin@linux.ibm.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>

Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
parent ddd36535
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment