reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* reiser4: discard implementation, part 2: FITRIM ioctl aka batch mode
@ 2014-06-30  9:35 Ivan Shapovalov
  2014-06-30 12:19 ` Edward Shishkin
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Shapovalov @ 2014-06-30  9:35 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: Edward Shishkin

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-30 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30  9:35 reiser4: discard implementation, part 2: FITRIM ioctl aka batch mode Ivan Shapovalov
2014-06-30 12:19 ` Edward Shishkin
2014-06-30 13:24   ` Ivan Shapovalov
2014-06-30 23:59     ` Edward Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).