linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] ext4: add support fast commit
@ 2019-08-09  3:45 Harshad Shirwadkar
  2019-08-09  3:45 ` [PATCH v2 01/12] ext4: add handling for extended mount options Harshad Shirwadkar
                   ` (11 more replies)
  0 siblings, 12 replies; 36+ messages in thread
From: Harshad Shirwadkar @ 2019-08-09  3:45 UTC (permalink / raw)
  To: linux-ext4; +Cc: Harshad Shirwadkar

This patch series adds support for fast commits which is a simplified
version of the scheme proposed by Park and Shin, in their paper,
"iJournaling: Fine-Grained Journaling for Improving the Latency of
Fsync System Call"[1]. The basic idea of fast commits is to make JBD2
give the client file system an opportunity to perform a faster
commit. Only if the file system cannot perform such a commit
operation, then JBD2 should fall back to traditional commits.

Because JBD2 operates at block granularity, for every file system
metadata update it commits all the changed blocks to the journal at
commit time. This is inefficient because updates to some blocks that
JBD2 commits are derivable from some other blocks. For example, if a
new extent is added to an inode, then corresponding updates to the
inode table, the block bitmap, the group descriptor and the superblock
can be derived based on just the extent information and the
corresponding inode information. So, if we take this relationship
between blocks into account and replay the journalled blocks smartly,
we could increase performance of file system commits significantly.

Fast commits introduced in this patch has two main contributions:

(1) Making JBD2 fast commit aware, so that clients of JBD2 can
    implement fast commits

(2) Add support in ext4 to use JBD2's new interfaces and implement
    fast commits

Testing
-------

e2fsprogs was updated to set fast commit feature flag and to ignore
fast commit blocks during e2fsck.

https://github.com/harshadjs/e2fsprogs.git

After applying all the patches in this series, following runs of
xfstests were performed:

- kvm-xfstest.sh -g log -c 4k
- kvm-xfstests.sh smoke

All the log tests were successful and smoke tests didn't introduce any
additional failures.

Performance Evaluation
----------------------

In order to evaluate fast commit performance we used fs_mark
benchmark. We updated fs_mark benchmark to send fsync() calls after
every write operation.

https://github.com/harshadjs/fs_mark.git

Following are the results that we got:

Write performance measured in MB/s with 4 parallel threads file sizes
(X) vs write unit sizes (Y).

Without Fast Commit:

|-----+------+------+------|
|     |  32k | 128k | 256k |
|-----+------+------+------|
| 4k  | 0.27 | 0.25 | 0.24 |
| 8k  | 0.45 | 0.51 | 0.46 |
| 32k | 2.15 | 2.23 | 2.28 |
|-----+------+------+------|

With Fast Commit:

|-----+------+------+------|
|     |  32k | 128k | 256k |
|-----+------+------+------|
| 4k  | 0.74 | 1.42 | 1.94 |
| 8k  | 1.52 | 1.88 | 2.48 |
| 32k |  1.8 | 4.29 | 7.38 |
|-----+------+------+------|

On an average, fast commits increased file system write performance by
280% on modified fs_mark benchmark.

Harshad Shirwadkar(13):
 docs: Add fast commit documentation
 ext4: fast-commit recovery path changes
 ext4: fast-commit commit path changes
 ext4: fast-commit commit range tracking
 ext4: track changed files for fast commit
 ext4: add fields that are needed to track changed files
 jbd2: fast-commit recovery path changes
 jbd2: fast-commit commit path new APIs
 jbd2: fast-commit commit path changes
 jbd2: fast commit setup and enable
 jbd2: add fast commit fields to journal_s structure
 ext4: add handling for extended mount options
 ext4: add support fast commit

 Documentation/filesystems/ext4/journal.rst |   78 ++
 Documentation/filesystems/journalling.rst  |   15
 fs/ext4/acl.c                              |    1
 fs/ext4/balloc.c                           |    7
 fs/ext4/ext4.h                             |   87 +++
 fs/ext4/ext4_jbd2.c                        |   92 +++
 fs/ext4/ext4_jbd2.h                        |   29 +
 fs/ext4/extents.c                          |   44 +
 fs/ext4/fsync.c                            |    2
 fs/ext4/ialloc.c                           |    1
 fs/ext4/inline.c                           |   17
 fs/ext4/inode.c                            |   62 +-
 fs/ext4/ioctl.c                            |    3
 fs/ext4/mballoc.c                          |   83 ++
 fs/ext4/mballoc.h                          |    2
 fs/ext4/migrate.c                          |    1
 fs/ext4/namei.c                            |   14
 fs/ext4/super.c                            |  538 ++++++++++++++++++-
 fs/ext4/xattr.c                            |    1
 fs/jbd2/checkpoint.c                       |    2
 fs/jbd2/commit.c                           |   85 ++-
 fs/jbd2/journal.c                          |  230 +++++++-
 fs/jbd2/recovery.c                         |   70 ++
 fs/jbd2/transaction.c                      |    6
 fs/ocfs2/alloc.c                           |    2
 fs/ocfs2/journal.c                         |    4
 fs/ocfs2/super.c                           |    2
 include/linux/jbd2.h                       |  106 +++
 include/trace/events/ext4.h                |   59 ++
 include/trace/events/jbd2.h                |    9
 30 files changed, 1561 insertions(+), 91 deletions(-)
-- 
2.23.0.rc1.153.gdeed80330f-goog


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

end of thread, other threads:[~2019-11-01 11:23 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  3:45 [PATCH v2 00/12] ext4: add support fast commit Harshad Shirwadkar
2019-08-09  3:45 ` [PATCH v2 01/12] ext4: add handling for extended mount options Harshad Shirwadkar
2019-08-09 19:41   ` Andreas Dilger
2019-08-12 14:22   ` Theodore Y. Ts'o
2019-08-09  3:45 ` [PATCH v2 02/12] jbd2: add fast commit fields to journal_s structure Harshad Shirwadkar
2019-08-09 19:48   ` Andreas Dilger
2019-10-01  7:50     ` harshad shirwadkar
2019-08-09  3:45 ` [PATCH v2 03/12] jbd2: fast commit setup and enable Harshad Shirwadkar
2019-08-09 20:02   ` Andreas Dilger
2019-10-01  7:52     ` harshad shirwadkar
2019-11-01 11:22       ` xiaohui li
2019-08-09  3:45 ` [PATCH v2 04/12] jbd2: fast-commit commit path changes Harshad Shirwadkar
2019-08-09 20:22   ` Andreas Dilger
2019-10-01  7:43     ` harshad shirwadkar
2019-08-09  3:45 ` [PATCH v2 05/12] jbd2: fast-commit commit path new APIs Harshad Shirwadkar
2019-08-09 20:38   ` Andreas Dilger
2019-08-09 21:11     ` Andreas Dilger
2019-08-09 21:20       ` harshad shirwadkar
2019-08-12 16:04   ` Theodore Y. Ts'o
2019-08-12 17:41     ` harshad shirwadkar
2019-08-12 18:01       ` Theodore Y. Ts'o
2019-08-09  3:45 ` [PATCH v2 06/12] jbd2: fast-commit recovery path changes Harshad Shirwadkar
2019-08-09 20:57   ` Andreas Dilger
2019-08-09  3:45 ` [PATCH v2 07/12] ext4: add fields that are needed to track changed files Harshad Shirwadkar
2019-08-09 21:23   ` Andreas Dilger
2019-10-01  7:50     ` harshad shirwadkar
2019-08-09  3:45 ` [PATCH v2 08/12] ext4: track changed files for fast commit Harshad Shirwadkar
2019-08-09 21:46   ` Andreas Dilger
2019-10-01  7:51     ` harshad shirwadkar
2019-08-09  3:45 ` [PATCH v2 09/12] ext4: fast-commit commit range tracking Harshad Shirwadkar
2019-08-09  3:45 ` [PATCH v2 10/12] ext4: fast-commit commit path changes Harshad Shirwadkar
2019-08-09  3:45 ` [PATCH v2 11/12] ext4: fast-commit recovery " Harshad Shirwadkar
2019-08-09  3:45 ` [PATCH v2 12/12] docs: Add fast commit documentation Harshad Shirwadkar
2019-08-16  1:00   ` Darrick J. Wong
2019-08-20  6:38     ` harshad shirwadkar
2019-08-21 15:21       ` Darrick J. Wong

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