ext4: Give symbolic names to mballoc criterias

mballoc criterias have historically been called by numbers
like CR0, CR1... however this makes it confusing to understand
what each criteria is about.

Change these criterias from numbers to symbolic names and add
relevant comments. While we are at it, also reformat and add some
comments to ext4_seq_mb_stats_show() for better readability.

Additionally, define CR_FAST which signifies the criteria
below which we can make quicker decisions like:
  * quitting early if (free block < requested len)
  * avoiding to scan free extents smaller than required len.
  * avoiding to initialize buddy cache and work with existing cache
  * limiting prefetches

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/a2dc6ec5aea5e5e68cf8e788c2a964ffead9c8b0.1685449706.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Ojaswin Mujoo
2023-05-30 18:03:50 +05:30
committed by Theodore Ts'o
parent 7e170922f0
commit f52f3d2b9f
5 changed files with 210 additions and 146 deletions

View File

@@ -120,19 +120,19 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_MAX);
{ EXT4_FC_REASON_INODE_JOURNAL_DATA, "INODE_JOURNAL_DATA"}, \
{ EXT4_FC_REASON_ENCRYPTED_FILENAME, "ENCRYPTED_FILENAME"})
TRACE_DEFINE_ENUM(CR0);
TRACE_DEFINE_ENUM(CR1);
TRACE_DEFINE_ENUM(CR1_5);
TRACE_DEFINE_ENUM(CR2);
TRACE_DEFINE_ENUM(CR3);
TRACE_DEFINE_ENUM(CR_POWER2_ALIGNED);
TRACE_DEFINE_ENUM(CR_GOAL_LEN_FAST);
TRACE_DEFINE_ENUM(CR_BEST_AVAIL_LEN);
TRACE_DEFINE_ENUM(CR_GOAL_LEN_SLOW);
TRACE_DEFINE_ENUM(CR_ANY_FREE);
#define show_criteria(cr) \
__print_symbolic(cr, \
{ CR0, "CR0" }, \
{ CR1, "CR1" }, \
{ CR1_5, "CR1.5" } \
{ CR2, "CR2" }, \
{ CR3, "CR3" })
#define show_criteria(cr) \
__print_symbolic(cr, \
{ CR_POWER2_ALIGNED, "CR_POWER2_ALIGNED" }, \
{ CR_GOAL_LEN_FAST, "CR_GOAL_LEN_FAST" }, \
{ CR_BEST_AVAIL_LEN, "CR_BEST_AVAIL_LEN" }, \
{ CR_GOAL_LEN_SLOW, "CR_GOAL_LEN_SLOW" }, \
{ CR_ANY_FREE, "CR_ANY_FREE" })
TRACE_EVENT(ext4_other_inode_update_time,
TP_PROTO(struct inode *inode, ino_t orig_ino),