All of lore.kernel.org
 help / color / mirror / Atom feed
From: zwu.kernel@gmail.com
To: linux-fsdevel@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxram@linux.vnet.ibm.com,
	viro@zeniv.linux.org.uk, david@fromorbit.com, tytso@mit.edu,
	cmm@us.ibm.com, wuzhy@linux.vnet.ibm.com, wenqing.lz@taobao.com,
	Zhi Yong Wu <zwu.kernel@gmail.com>
Subject: [RFC v4+ hot_track 18/19] ext4: add hot tracking support
Date: Mon, 29 Oct 2012 12:31:00 +0800	[thread overview]
Message-ID: <1351485061-12297-19-git-send-email-zwu.kernel@gmail.com> (raw)
In-Reply-To: <1351485061-12297-1-git-send-email-zwu.kernel@gmail.com>

From: Zheng Liu <wenqing.lz@taobao.com>

  Define a new mount option to add VFS hot
tracking support in order to use it in ext4.

CC: Zhi Yong Wu <zwu.kernel@gmail.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/ext4.h  |    3 +++
 fs/ext4/super.c |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 3c20de1..f6cff1e 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1298,6 +1298,9 @@ struct ext4_sb_info {
 
 	/* Precomputed FS UUID checksum for seeding other checksums */
 	__u32 s_csum_seed;
+
+	/* Enable hot tracking or not */
+	int s_hottrack_enable;
 };
 
 static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 80928f7..ba9f376 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -864,6 +864,8 @@ static void ext4_put_super(struct super_block *sb)
 	ext4_ext_release(sb);
 	ext4_xattr_put_super(sb);
 
+	if (sbi->s_hottrack_enable)
+		hot_track_exit(sb);
 	if (!(sb->s_flags & MS_RDONLY)) {
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
 		es->s_state = cpu_to_le16(sbi->s_mount_state);
@@ -1222,7 +1224,7 @@ enum {
 	Opt_inode_readahead_blks, Opt_journal_ioprio,
 	Opt_dioread_nolock, Opt_dioread_lock,
 	Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
-	Opt_max_dir_size_kb,
+	Opt_max_dir_size_kb, Opt_hottrack,
 };
 
 static const match_table_t tokens = {
@@ -1297,6 +1299,7 @@ static const match_table_t tokens = {
 	{Opt_init_itable, "init_itable"},
 	{Opt_noinit_itable, "noinit_itable"},
 	{Opt_max_dir_size_kb, "max_dir_size_kb=%u"},
+	{Opt_hottrack, "hot_track"},
 	{Opt_removed, "check=none"},	/* mount option from ext2/3 */
 	{Opt_removed, "nocheck"},	/* mount option from ext2/3 */
 	{Opt_removed, "reservation"},	/* mount option from ext2/3 */
@@ -1595,6 +1598,14 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
 			sbi->s_li_wait_mult = arg;
 		} else if (token == Opt_max_dir_size_kb) {
 			sbi->s_max_dir_size_kb = arg;
+		} else if (token == Opt_hottrack) {
+			if (hot_track_init(sb)) {
+				ext4_msg(sb, KERN_ERR,
+					"EXT4-fs: hot tracking initialization"
+					" failed");
+				return -1;
+			}
+			sbi->s_hottrack_enable = 1;
 		} else if (token == Opt_stripe) {
 			sbi->s_stripe = arg;
 		} else if (m->flags & MOPT_DATAJ) {
-- 
1.7.6.5


  parent reply	other threads:[~2012-10-29  4:33 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29  4:30 [RFC v4+ hot_track 00/19] vfs: hot data tracking zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 01/19] vfs: introduce private radix tree structures zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 02/19] vfs: initialize and free data structures zwu.kernel
2012-11-06 22:24   ` David Sterba
2012-11-07  6:55     ` Zhi Yong Wu
2012-11-16  6:16     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 03/19] vfs: add I/O frequency update function zwu.kernel
2012-11-05 11:07   ` Steven Whitehouse
2012-11-05 11:47     ` Zhi Yong Wu
2012-11-06 22:37   ` David Sterba
2012-11-07  7:03     ` Zhi Yong Wu
2012-11-06 22:45   ` Darrick J. Wong
2012-11-07  8:27     ` Zhi Yong Wu
2012-11-07 18:49       ` Darrick J. Wong
2012-11-08  2:52         ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 04/19] vfs: add two map arrays zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 05/19] vfs: add hooks to enable hot tracking zwu.kernel
2012-11-06 22:51   ` David Sterba
2012-11-07  7:06     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 06/19] vfs: add temp calculation function zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 07/19] vfs: add map info update function zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 08/19] vfs: add aging function zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 09/19] vfs: add one work queue zwu.kernel
2012-11-05 11:21   ` Steven Whitehouse
2012-11-05 11:55     ` Zhi Yong Wu
2012-11-05 12:07       ` Steven Whitehouse
2012-11-05 12:20         ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 10/19] vfs: introduce hot func register framework zwu.kernel
2012-11-06 23:14   ` David Sterba
2012-11-07  7:18     ` Zhi Yong Wu
2012-11-06 23:30   ` Darrick J. Wong
2012-11-07  8:34     ` Zhi Yong Wu
2012-11-07 18:58       ` Darrick J. Wong
2012-11-08  2:59         ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 11/19] vfs: register one shrinker zwu.kernel
2012-10-29  4:30 ` [RFC v4+ hot_track 12/19] vfs: add one ioctl interface zwu.kernel
2012-11-06 23:30   ` David Sterba
2012-11-07  7:36     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 13/19] debugfs: introduce one function zwu.kernel
2012-10-29 18:11   ` Greg KH
2012-10-29 22:25     ` Zhi Yong Wu
2012-10-29 22:34       ` Greg KH
2012-10-29 22:45         ` Zhi Yong Wu
2012-10-29 22:54           ` Greg KH
2012-10-29 22:58             ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 14/19] vfs: add debugfs support zwu.kernel
2012-11-06 23:45   ` David Sterba
2012-11-07  7:49     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 15/19] sysfs: add two hot_track proc files zwu.kernel
2012-10-29 18:10   ` Greg KH
2012-10-29 22:26     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 16/19] btrfs: add hot tracking support zwu.kernel
2012-11-07  0:00   ` David Sterba
2012-11-07  8:03     ` Zhi Yong Wu
2012-10-29  4:30 ` [RFC v4+ hot_track 17/19] xfs: " zwu.kernel
2012-10-29  4:31 ` zwu.kernel [this message]
2012-10-29  4:31 ` [RFC v4+ hot_track 19/19] vfs: add documentation zwu.kernel
2012-10-29 10:30 ` [RFC v4+ hot_track 00/19] vfs: hot data tracking Andi Kleen
2012-10-29 12:31   ` Zhi Yong Wu
2012-11-07  8:51 ` Zhi Yong Wu

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=1351485061-12297-19-git-send-email-zwu.kernel@gmail.com \
    --to=zwu.kernel@gmail.com \
    --cc=cmm@us.ibm.com \
    --cc=david@fromorbit.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@linux.vnet.ibm.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wenqing.lz@taobao.com \
    --cc=wuzhy@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.