Am Samstag, 14. Juni 2014, 02:53:20 schrieb Duncan: > > I am reaching the conclusion that fallocate is not the problem. The > > fallocate increase the filesize of about 8MB, which is enough for some > > logging. So it is not called very often. > > But... > > If a file isn't (properly[1]) set NOCOW (and the btrfs isn't mounted with > nodatacow), then an fallocate of 8 MiB will increase the file size by 8 > MiB and write that out. So far so good as at that point the 8 MiB should > be a single extent. But then, data gets written into 4 KiB blocks of > that 8 MiB one at a time, and because btrfs is COW, the new data in the > block must be written to a new location. > > Which effectively means that by the time the 8 MiB is filled, each 4 KiB > block has been rewritten to a new location and is now an extent unto > itself. So now that 8 MiB is composed of 2048 new extents, each one a > single 4 KiB block in size.
I always thought that the whole point of fallocate is that it *doesn´t* write out anything, but just reserves the space. Thus I don´t see how COW can have any adverse effect here. -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 -- 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