> From: Namjae Jeon <linkinjeon@xxxxxxxxxx> > Sent: Friday, December 22, 2023 1:09 PM > > From: Yuezhang Mo <mailto:Yuezhang.Mo@xxxxxxxx> > > > > When sync or dir_sync is enabled, there is no need to sync the parent > > directory's inode if only for updating its timestamp. > > > > 1. If an unexpected power failure occurs, the timestamp of the > > parent directory is not updated to the storage, which has no > > impact on the user. > Well, Why do you think timestamp sync of parent dir is not important ? If the size of the parent directory does not change (only the timestamp of the parent directory needs to be synchronized), synchronizing the dentry set of the parent directory is not as important as synchronizing the dentry set of the target file. In the case of a large number of file operations, skipping the synchronization of the parent directory timestamp can allow the file operations to be completed faster and shorten the file operation completion time. The risk of user data loss is greater if there is a possibility of unexpected power outage and the process is not completed for a long time. By skipping the synchronization of the parent directory timestamp, even if the parent directory timestamp is not updated due to an unexpected power outage, the file operation will still be successful. > > > > 2. The number of writes will be greatly reduced, which can not > > only improve performance, but also prolong device life. > How much does this have on your measurement results? I did not measure the improvements brought by this patch alone, the improvements brought by this patch set are listed in [0/11]. If without this patch, 2 dentry sets(the target file dentry set and the parent dir dentry set) will be sync in a file operation. If with this patch, 1 dentry set(the target file dentry set) will be sync in a file operation, the parent dir dentry set will not be sync in most case. So this patch reduces metadata synchronization by nearly half.