We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e15e117 commit 772c9f6Copy full SHA for 772c9f6
fs/ext4/mballoc.c
@@ -966,7 +966,18 @@ static void ext4_mb_choose_next_group_goal_fast(struct ext4_allocation_context *
966
}
967
968
969
- *new_cr = CR_BEST_AVAIL_LEN;
+ /*
970
+ * CR_BEST_AVAIL_LEN works based on the concept that we have
971
+ * a larger normalized goal len request which can be trimmed to
972
+ * a smaller goal len such that it can still satisfy original
973
+ * request len. However, allocation request for non-regular
974
+ * files never gets normalized.
975
+ * See function ext4_mb_normalize_request() (EXT4_MB_HINT_DATA).
976
+ */
977
+ if (ac->ac_flags & EXT4_MB_HINT_DATA)
978
+ *new_cr = CR_BEST_AVAIL_LEN;
979
+ else
980
+ *new_cr = CR_GOAL_LEN_SLOW;
981
982
983
/*
0 commit comments