Re: shared extents, but no snapshots or reflinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



23.08.2019 6:19, Chris Murphy пишет:
> On Thu, Aug 22, 2019 at 8:38 PM Chris Murphy <lists@xxxxxxxxxxxxxxxxx> wrote:
>>
>> There have previously been snapshots, typically prior to doing system
>> updates. Is this an example of extents being pinned due to snapshots,
>> and then extents updated and are now "stuck"? I'm kinda surprised, in
>> that I'd expect most programs, especially RPM, are writing out new
>> files entirely, then deleting obsolete files, then renaming. But...
>> this suggests something is doing partial overwrites of file extents
>> rather than replacements.
> 
> It's databases. Databases are updating their files with block
> overwrites, btrfs COWs them. And if there's a snapshot that exists
> while COW happens, partial extents get pinned. This affects the
> firefox database files, and also RPM's. It's a small effect on my
> system, but it's a curious issue in particular if the files were much
> larger.
> 
> 

What exactly "pinned" means, why it happens and when it goes away?

Comparing situation with and without shared extents - when you simply
delete snapshot, it disappears:


-       item 12 key (257 ROOT_ITEM 7) itemoff 13188 itemsize 439
-               generation 7 root_dirid 256 bytenr 30670848 level 0 refs 1
-               lastsnap 7 byte_limit 0 bytes_used 16384 flags 0x1(RDONLY)
-               uuid 5357e159-c577-d34b-8e0e-815767568a89
-               parent_uuid 1dfec531-ef6e-4d2e-a93b-2a4e4c0e4682
-               ctransid 6 otransid 7 stransid 0 rtransid 0
-               ctime 1566719522.371361184 (2019-08-25 10:52:02)
-               otime 1566719541.289249684 (2019-08-25 10:52:21)
-               drop key (0 UNKNOWN.0 0) level 0
-       item 13 key (257 ROOT_BACKREF 5) itemoff 13166 itemsize 22
-               root backref key dirid 258 sequence 2 name snap


but when there was shared extent (caused by partial overwrite) it is stuck:

-       item 12 key (257 ROOT_ITEM 7) itemoff 13188 itemsize 439
-               generation 7 root_dirid 256 bytenr 30670848 level 0 refs 1
-               lastsnap 7 byte_limit 0 bytes_used 16384 flags 0x1(RDONLY)
+       item 11 key (257 ROOT_ITEM 7) itemoff 13210 itemsize 439
+               generation 7 root_dirid 256 bytenr 30670848 level 0 refs 0
+               lastsnap 7 byte_limit 0 bytes_used 16384 flags
0x1000000000001(RDONLY)


Now the undecoded flag is

/*
 * Internal in-memory flag that a subvolume has been marked for deletion but
 * still visible as a directory
 */
#define BTRFS_ROOT_SUBVOL_DEAD          (1ULL << 48)

but it does not agree with comment - this flag is not "in memory", it is
persistent (output above is from inspect-internal after filesystem is
unmounted).

So when this dead subvolume is going to be removed? This can cause quite
real memory leak if it is stuck as long as original extent reference
remains.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux