reiser4: discard implementation, part 2: FITRIM ioctl aka batch mode

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

 



Hi,

I've started to think about implementing the second part of discard support,
namely "batch mode" (FITRIM ioctl). And it seems like I don't yet quite
understand how to do it.

It had been suggested to reuse existing transaction and discard machinery for
this feature: create a transaction, allocate+deallocate all possible blocks
and then force-commit it.

However, the algorithms of discard_atom() are very inoptimal for discarding
large amounts of known free space -- a bitmap check is performed for every
single discard unit. Repeatedly calling reiser4_alloc_blocks() to allocate
every possible block also seems inefficient. And this will still miss those
10% of reserved space, IIUC.

So the best way I can imagine is to introduce a new space allocator method,
"iterate free space", and discard all reported extents (blkdev_issue_discard()
will take care of aligning them properly).

With such method, a question arises: how to prevent bitmap modifications
and disk writes to free space when such iteration is in progress?

Thanks,
-- 
Ivan Shapovalov / intelfx /

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux