On 2019/1/15 上午1:11, David Sterba wrote: > On Mon, Jan 07, 2019 at 01:41:47PM +0800, Qu Wenruo wrote: >> +/* >> + * Helper structure to keep record of a file tree whose reloc >> + * root needs to be cleaned up. >> + * >> + * Since reloc_control is used less frequently than btrfs_root, this should >> + * prevent us to add another structure in btrfs_root. > > The alternative is to keep that in btrfs_root and avoid all allocations > that also remove one failure possibility. The overall root structure > size is over 1K already and roots get allocated from the generic slabs, > so quite possible from the 2K slab anyway. A few more bytes will not be > that expensive though the number of uses of the data would be very low. > > Memory failures are ok for restartable operations and at the beginning > of the operation. Imagine that relocation fails with ENOMEM after hours > of shuffling data just before it is about to finish. > > I think in another patch you add 128 bytes to btrfs_root anyway, so some > kind of memory consumption increas will happen anyway. Indeed, I'll just use a list_head in btrfs_root to record this. Thanks, Qu