lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: Michael Jeanson <mjeanson@efficios.com>
To: lttng-dev@lists.lttng.org
Subject: [PATCH lttng-modules] fix: ext4: Reserve revoke credits for freed blocks (v5.5)
Date: Tue, 10 Dec 2019 11:41:14 -0500	[thread overview]
Message-ID: <20191210164114.26954-5-mjeanson__18812.7513438062$1575996235$gmane$org@efficios.com> (raw)
In-Reply-To: <20191210164114.26954-1-mjeanson@efficios.com>

See upstream commit:

  commit 83448bdfb59731c2f54784ed3f4a93ff95be6e7e
  Author: Jan Kara <jack@suse.cz>
  Date:   Tue Nov 5 17:44:29 2019 +0100

    ext4: Reserve revoke credits for freed blocks

    So far we have reserved only relatively high fixed amount of revoke
    credits for each transaction. We over-reserved by large amount for most
    cases but when freeing large directories or files with data journalling,
    the fixed amount is not enough. In fact the worst case estimate is
    inconveniently large (maximum extent size) for freeing of one extent.

    We fix this by doing proper estimate of the amount of blocks that need
    to be revoked when removing blocks from the inode due to truncate or
    hole punching and otherwise reserve just a small amount of revoke
    credits for each transaction to accommodate freeing of xattrs block or
    so.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
 instrumentation/events/lttng-module/ext4.h | 31 +++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
index b2ca8a7..17809d2 100644
--- a/instrumentation/events/lttng-module/ext4.h
+++ b/instrumentation/events/lttng-module/ext4.h
@@ -1255,7 +1255,36 @@ LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
 	)
 )
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+
+LTTNG_TRACEPOINT_EVENT(ext4_journal_start,
+	TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
+		 int revoke_creds, unsigned long IP),
+
+	TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP),
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, sb->s_dev)
+		ctf_integer(unsigned long, ip, IP)
+		ctf_integer(int, blocks, blocks)
+		ctf_integer(int, rsv_blocks, rsv_blocks)
+		ctf_integer(int, revoke_creds, revoke_creds)
+	)
+)
+
+LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved,
+	TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
+
+	TP_ARGS(sb, blocks, IP),
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, sb->s_dev)
+		ctf_integer(unsigned long, ip, IP)
+		ctf_integer(int, blocks, blocks)
+	)
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
 
 LTTNG_TRACEPOINT_EVENT(ext4_journal_start,
 	TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
-- 
2.17.1

  parent reply	other threads:[~2019-12-10 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191210164114.26954-1-mjeanson@efficios.com>
2019-12-10 16:41 ` [PATCH lttng-modules] fix: y2038: itimer: change implementation to timespec64 (v5.5) Michael Jeanson
2019-12-10 16:41 ` [PATCH lttng-modules] fix: btrfs: tracepoints: constify all pointers (v5.5) Michael Jeanson
2019-12-10 16:41 ` [PATCH lttng-modules] fix: btrfs block group struct refactor (v5.5) Michael Jeanson
2019-12-10 16:41 ` Michael Jeanson [this message]
2019-12-10 17:19 ` [PATCH lttng-modules] Update .gitignore from upstream Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20191210164114.26954-5-mjeanson__18812.7513438062$1575996235$gmane$org@efficios.com' \
    --to=mjeanson@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).