linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: zwu.kernel@gmail.com
Cc: linux-fsdevel@vger.kernel.org, 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,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Subject: Re: [RFC v4 03/15] vfs,hot_track: add the function for collecting I/O frequency
Date: Sun, 28 Oct 2012 15:55:20 +0800	[thread overview]
Message-ID: <20121028075520.GA14554@gmail.com> (raw)
In-Reply-To: <1351177747-19389-4-git-send-email-zwu.kernel@gmail.com>

Hi Zhiyong, 

On Thu, Oct 25, 2012 at 11:08:55PM +0800, zwu.kernel@gmail.com wrote:
[snip]
> @@ -199,6 +342,54 @@ err:
>  }
>  
>  /*
> + * Main function to update access frequency from read/writepage(s) hooks
> + */
> +inline void hot_update_freqs(struct inode *inode, u64 start,
> +			u64 len, int rw)

This function seems too big.  So we really need to inline this function?

Regards,
Zheng

> +{
> +	struct hot_info *root = inode->i_sb->s_hot_root;
> +	struct hot_inode_item *he;
> +	struct hot_range_item *hr;
> +	u32 cur, end;
> +
> +	if (!root || (len == 0))
> +		return;
> +
> +	he = hot_inode_item_find(root, inode->i_ino);
> +	if (IS_ERR(he)) {
> +		WARN_ON(1);
> +		return;
> +	}
> +
> +	spin_lock(&he->hot_inode.lock);
> +	hot_freq_data_update(&he->hot_inode.hot_freq_data, rw);
> +	spin_unlock(&he->hot_inode.lock);
> +
> +	/*
> +	 * Align ranges on RANGE_SIZE boundary
> +	 * to prevent proliferation of range structs
> +	 */
> +	end = (start + len + RANGE_SIZE - 1) >> RANGE_BITS;
> +	for (cur = (start >> RANGE_BITS); cur < end; cur++) {
> +		hr = hot_range_item_find(he, cur);
> +		if (IS_ERR(hr)) {
> +			WARN_ON(1);
> +			hot_inode_item_put(he);
> +			return;
> +		}
> +
> +		spin_lock(&hr->hot_range.lock);
> +		hot_freq_data_update(&hr->hot_range.hot_freq_data, rw);
> +		spin_unlock(&hr->hot_range.lock);
> +
> +		hot_range_item_put(hr);
> +	}
> +
> +	hot_inode_item_put(he);
> +}
> +EXPORT_SYMBOL_GPL(hot_update_freqs);

  reply	other threads:[~2012-10-28  7:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 15:08 [RFC v4 00/15] vfs: hot data tracking zwu.kernel
2012-10-25 15:08 ` [RFC v4 01/15] vfs,hot_track: introduce private radix tree structures zwu.kernel
2012-10-25 15:08 ` [RFC v4 02/15] vfs,hot_track: initialize and free key data structures zwu.kernel
2012-10-25 15:08 ` [RFC v4 03/15] vfs,hot_track: add the function for collecting I/O frequency zwu.kernel
2012-10-28  7:55   ` Zheng Liu [this message]
2012-10-28 13:51     ` Zhi Yong Wu
2012-10-29  2:01       ` Dave Chinner
2012-10-29  2:14         ` Zhi Yong Wu
2012-10-25 15:08 ` [RFC v4 04/15] vfs,hot_track: add two map arrays zwu.kernel
2012-10-25 15:08 ` [RFC v4 05/15] vfs,hot_track: add hooks to enable hot data tracking zwu.kernel
2012-10-25 15:08 ` [RFC v4 06/15] vfs,hot_track: add the function for updating map arrays zwu.kernel
2012-10-25 15:08 ` [RFC v4 07/15] vfs,hot_track: add the aging function zwu.kernel
2012-10-25 15:09 ` [RFC v4 08/15] vfs,hot_track: add one work queue zwu.kernel
2012-10-25 15:09 ` [RFC v4 09/15] vfs,hot_track: register one memory shrinker zwu.kernel
2012-10-25 15:09 ` [RFC v4 10/15] vfs,hot_track: add one new ioctl interface zwu.kernel
2012-10-25 15:09 ` [RFC v4 11/15] vfs,hot_track: add debugfs support zwu.kernel
2012-10-25 15:09 ` [RFC v4 12/15] vfs,hot_track: turn some Micro into be tunable zwu.kernel
2012-10-25 15:09 ` [RFC v4 13/15] btrfs: add hot tracking support zwu.kernel
2012-10-25 15:09 ` [RFC v4 14/15] xfs: " zwu.kernel
2012-10-25 15:09 ` [RFC v4 15/15] vfs,hot_track: add the documentation zwu.kernel
2012-10-28  9:22 ` [PATCH] ext4: add hot tracking support Zheng Liu
2012-10-28 13:45   ` Zhi Yong Wu
2012-10-29  2:32     ` Zheng Liu
2012-10-29  2:24       ` Zhi Yong Wu
2012-11-07  8:37   ` 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=20121028075520.GA14554@gmail.com \
    --to=gnehzuil.liu@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=wuzhy@linux.vnet.ibm.com \
    --cc=zwu.kernel@gmail.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 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).