All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Andi Kleen <ak@linux.intel.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org, tim.c.chen@linux.intel.com
Subject: Re: [RFC, PATCH] Avoid hot statistics cache line in ext4 extent cache
Date: Fri, 23 Mar 2012 19:10:31 -0600	[thread overview]
Message-ID: <A3DE1F37-C0AB-4ACE-8D13-22DC8A21ED3C@dilger.ca> (raw)
In-Reply-To: <20120323221715.GA6712@tassilo.jf.intel.com>

On 2012-03-23, at 4:17 PM, Andi Kleen wrote:
> We found that the super block cache line containing the extent cache
> hit/miss statistics counters is very hot in IO workloads.  
> 
> Besides the counter seems racy anyways and can lose updates because
> it's not atomic.
> 
> Disabling the counter make a very measurable difference in some IO
> micro benchmarks on a 4S system.
> 
> I just disabled it for now because it doesn't seem very useful due
> to its racy nature. An alternative would be to turn it into a per
> cpu counter, if someone really needs it.
> 
> Simple patch to disable it appended.
> 
> -Andi

The patch only disables the statistics counting, but not the sysfs
files that will now report bogus statistics.  I don't disagree with
disabling these stats, but if you are disabling the accounting you
should also comment out the functions in fs/ext4/super.c that are
printing out these statistics.

Cheers, Andreas

> ---
> 
> Disable statistics counter in ext4
> 
> This super bloc cache line is very hot and slows down high IO 
> workloads.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 74f23c2..7310b0e 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2049,10 +2049,12 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
> 		ret = 1;
> 	}
> errout:
> +#if 0
> 	if (!ret)
> 		sbi->extent_cache_misses++;
> 	else
> 		sbi->extent_cache_hits++;
> +#endif
> 	trace_ext4_ext_in_cache(inode, block, ret);
> 	spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> 	return ret;
> 
> -- 
> ak@linux.intel.com -- Speaking for myself only
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html





  reply	other threads:[~2012-03-24  1:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 22:17 [RFC, PATCH] Avoid hot statistics cache line in ext4 extent cache Andi Kleen
2012-03-24  1:10 ` Andreas Dilger [this message]
2012-03-24  3:13   ` Andi Kleen
2012-03-26 22:26     ` Vivek Haldar
2012-03-26 23:00       ` Andi Kleen
2012-03-26 23:57         ` Ted Ts'o
2012-04-11 16:59           ` Andi Kleen
2012-04-13 17:42             ` Linus Torvalds
2012-04-13 17:53               ` Tim Chen
2012-04-13 18:08                 ` Linus Torvalds
2012-04-13 18:31                   ` Tim Chen
2012-04-13 18:33                     ` Linus Torvalds
2012-04-13 18:37                     ` Ted Ts'o
2012-04-13 18:41                       ` Andi Kleen
2012-04-13 18:48                         ` Ted Ts'o
2012-04-13 19:01                           ` Eric Whitney
2012-04-13 19:26                       ` Tim Chen
2012-04-13 19:33                         ` Ted Ts'o
2012-04-13 17:57               ` Andi Kleen
2012-04-13 18:06               ` Ted Ts'o
2012-04-13 18:22                 ` Andi Kleen

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=A3DE1F37-C0AB-4ACE-8D13-22DC8A21ED3C@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=ak@linux.intel.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tytso@mit.edu \
    /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.