reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv5 00/10] reiser4: batch discard support (FITRIM ioctl): initial implementation.
@ 2015-02-13  0:48 Ivan Shapovalov
  2015-02-13  0:48 ` [PATCHv5 01/10] reiser4: block_alloc: add BA_SOME_SPACE flag for grabbing a fixed amount of space Ivan Shapovalov
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Ivan Shapovalov @ 2015-02-13  0:48 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: Ivan Shapovalov

This patch series implements FITRIM ioctl support in reiser4.

The FITRIM ioctl is supposed to be applied to any directory inside the target
filesystem. At least, this can be deduced from `fstrim` utility behavior on
mainstream filesystems (e. g. ext2/3/4).

The idea of implementation is per Edward's advices: FITRIM handler iteratively
grabs a portion of disk space, sequentially allocates extents within grabbed
space and commits the resulting atom. This way we avoid starving concurrent
processes of the disk space. This process is repeated until the partition has
been fully scanned and processed.

Points I'm really uncertain of:
- creation of empty atoms (reiser4_create_atom())
- handling of empty atoms in commit_current_atom()

v2: - fix PATCH 5/7 "reiser4: txnmgr: call reiser4_post_write_back_hook() for empty atoms."
      * fix a typo
      * release atom spinlock before calling reiser4_post_write_back_hook()

v3: - use bitwise shift instead of integer division by 4 to calculate 25%
    - honor "minlen" of ioctl parameters (minimal extent length to consider for discarding)
    - fix a stupidity in reiser4_trim_fs() (two local variables holding the same superblock pointer)

v4: - refactor BA_SOME_SPACE implementation, fix calculation of space-to-grab if !BA_RESERVED
    - rename reiser4_blocknr_hint's "forward" to "monotonic_forward"
    - move free space accounting by pre-commit hook to block_alloc.c
    - explain BA_DEFER flag behavior in comments
    - fix "minlen" addition to alloc_blocks_forward() (use minlen in both calls)
    - refactor (equivalent at this time ;)) reiser4_trim_fs()
    - move "capture_count == 0" shortcut in commit_current_atom() below
      current_atom_complete_writes() in order to finish the atom's flush_queues

v5: - return -ENOTTY instead of -ENOSYS in the unsupported ioctl path
      of reiser4_ioctl_dir_common()

Ivan Shapovalov (10):
  reiser4: block_alloc: add BA_SOME_SPACE flag for grabbing a fixed amount of space.
  reiser4: block_alloc: add a "monotonic_forward" parameter to reiser4_blocknr_hint to allocate blocks only in forward direction.
  reiser4: block_alloc: move block accounting by pre-commit hook into block_alloc.c and document BA_DEFER behavior.
  reiser4: txnmgr: free allocated but unneeded atom in atom_begin_and_assign_to_txnh().
  reiser4: txnmgr: add reiser4_create_atom() which creates an empty atom without capturing any nodes.
  reiser4: txnmgr: move "empty atom" shortcut slightly below.
  reiser4: batch discard support: add a dummy FITRIM ioctl handler for directories.
  reiser4: batch discard support: actually implement the FITRIM ioctl handler.
  reiser4: block_alloc: add a "min_len" parameter to reiser4_blocknr_hint to limit allocated extent length from below.
  reiser4: batch discard support: honor minimal extent length passed from the userspace.

 fs/reiser4/block_alloc.c         |  66 +++++++++++++++++--
 fs/reiser4/block_alloc.h         |  12 +++-
 fs/reiser4/plugin/dir/dir.h      |   2 +
 fs/reiser4/plugin/file_ops.c     |  62 ++++++++++++++++++
 fs/reiser4/plugin/object.c       |   6 +-
 fs/reiser4/plugin/space/bitmap.c |  53 +++++++---------
 fs/reiser4/super_ops.c           | 134 +++++++++++++++++++++++++++++++++++++++
 fs/reiser4/txnmgr.c              |  57 +++++++++++------
 fs/reiser4/txnmgr.h              |   2 +
 9 files changed, 336 insertions(+), 58 deletions(-)

-- 
2.3.0


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

end of thread, other threads:[~2015-02-13  9:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13  0:48 [PATCHv5 00/10] reiser4: batch discard support (FITRIM ioctl): initial implementation Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 01/10] reiser4: block_alloc: add BA_SOME_SPACE flag for grabbing a fixed amount of space Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 02/10] reiser4: block_alloc: add a "monotonic_forward" parameter to reiser4_blocknr_hint to allocate blocks only in forward direction Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 03/10] reiser4: block_alloc: move block accounting by pre-commit hook into block_alloc.c and document BA_DEFER behavior Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 04/10] reiser4: txnmgr: free allocated but unneeded atom in atom_begin_and_assign_to_txnh() Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 05/10] reiser4: txnmgr: add reiser4_create_atom() which creates an empty atom without capturing any nodes Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 06/10] reiser4: txnmgr: move "empty atom" shortcut slightly below Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 07/10] reiser4: batch discard support: add a dummy FITRIM ioctl handler for directories Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 08/10] reiser4: batch discard support: actually implement the FITRIM ioctl handler Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 09/10] reiser4: block_alloc: add a "min_len" parameter to reiser4_blocknr_hint to limit allocated extent length from below Ivan Shapovalov
2015-02-13  0:48 ` [PATCHv5 10/10] reiser4: batch discard support: honor minimal extent length passed from the userspace Ivan Shapovalov
2015-02-13  2:11 ` When is the patch set included in the reiser4-for-3.x... release ? doiggl
2015-02-13  3:01   ` Ivan Shapovalov
2015-02-13  5:08     ` help with testing doiggl
2015-02-13  9:39 ` [PATCHv5 00/10] reiser4: batch discard support (FITRIM ioctl): initial implementation Ivan Shapovalov

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).