On Tue, Jun 25, 2024 at 12:06:14AM +0800, Jinliang Zheng wrote: > xfs_log_iovec is where all log data is saved. Compared to xfs_log_vec itself, > xfs_log_iovec occupies a larger memory space. > > When their memory spaces are allocated together, the memory occupied by > xfs_log_iovec can only be released after iclog is written to the disk log > space. But when xfs_log_iovec is written to iclog, its existence becomes > meaningless, because a copy of its content is already saved in iclog at this > time. > > And if they are separated, we can release its memory when the data in > xfs_log_iovec is written to iclog. The interval between these two time points > is not too small. > > Since xfs_log_iovec is the area that currently uses the most memory in > xfs_log_vec, this means that we have released quite a lot of memory. Freeing > memory that occupies a larger size earlier means smaller memory usage. This all needs to go into the commit log. Preferably including the actual quantity of memory saved for a useful workload.