Theodore Ts'o <tytso@xxxxxxx> 于2023年8月18日周五 01:31写道: > > On Mon, Aug 07, 2023 at 09:26:54AM +0800, zhangshida wrote: > > From: Shida Zhang <zhangshida@xxxxxxxxxx> > > > > Following Andreas' suggestion, it is time to adapt these helpers > > to handle larger records during runtime, especially in preparation > > for the eventual support of ext4 with a block size greater than > > PAGE_SIZE. > > Is there a reason for landing this now? We don't have support for > block_size > PAGE_SIZE yet, and this patch doesn't come for free, at > least not systems with page_size < 64k. These inline functions are > *very* hot and get used in a large number of places. Have you looked > to see what it might do to text size of the ext4 code? And whether > the expansion to the icache might actually impact performance on CPU > bound workloads with very large directories? > > I will note that there are some opportunities to optimize how often we > use ext4_rec_len_from_disk. For example, it gets called from > ext4_check_dir_entry(), and often the callers of that function will > need the directory record length. So having ext4_check_dir_entry() > optionally fill in the rec_len via a passed-in pointer might be > worthwhile. Yep, the best way to do it is to leave it unmerged until it is necessary. At the same time, I will try to eliminate these regression concerns based on these suggestions. Cheers, Shida > > Cheers, > > - Ted