On Thu, May 17, 2018 at 02:58:29PM +0800, Ethan Lien wrote: > In nocow path, we check if the extent is snapshotted in > btrfs_cross_ref_exist(). We can do the similar check earlier and avoid > unnecessary search into extent tree. > > A fio test on a Intel D-1531, 16GB RAM, SSD RAID-5 machine as follows: > > [global] > group_reporting > time_based > thread=1 > ioengine=libaio > bs=4k > iodepth=32 > size=64G > runtime=180 > numjobs=8 > rw=randwrite > > [file1] > filename=/mnt/nocow/testfile > > IOPS result: unpatched patched > > 1 fio round: 46670 46958 > snapshot > 2 fio round: 51826 54498 > 3 fio round: 59767 61289 > > After snapshot, the first fio get about 5% performance gain. As we > continually write to the same file, all writes will resume to nocow mode > and eventually we have no performance gain. > > Signed-off-by: Ethan Lien <ethanl...@synology.com> > --- > > V2: > Add comment and performance test.
Thanks, I maybe edit the comments further as do not feel like I understand why the shortcut can be safely taken just from reading it, but the code looks ok otherwise. I'll add the patch to for-next. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html