All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <cl@linux.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
	Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>,
	Jens Axboe <axboe@kernel.dk>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Rik van Riel <riel@redhat.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/9] readahead: add /debug/readahead/stats
Date: Fri, 27 Jan 2012 12:15:51 -0800	[thread overview]
Message-ID: <20120127121551.acd256aa.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1201271006480.16756@router.home>

On Fri, 27 Jan 2012 10:21:36 -0600 (CST)
Christoph Lameter <cl@linux.com> wrote:

> > +
> > +static void readahead_stats_reset(void)
> > +{
> > +	int i, j;
> > +
> > +	for (i = 0; i < RA_PATTERN_ALL; i++)
> > +		for (j = 0; j < RA_ACCOUNT_MAX; j++)
> > +			percpu_counter_set(&ra_stat[i][j], 0);
> 
> for_each_online(cpu)
> 	memset(per_cpu_ptr(&ra_stat, cpu), 0, sizeof(ra_stat));

for_each_possible_cpu().  And that's one reason to not open-code the
operation.  Another is so we don't have tiresome open-coded loops all
over the place.

But before doing either of those things we should choose boring old
atomic_inc().  Has it been shown that the cost of doing so is
unacceptable?  Bearing this in mind:

> The accounting code will be compiled in by default
> (CONFIG_READAHEAD_STATS=y), and will remain inactive by default.

I agree with those choices.  They effectively mean that the stats will
be a developer-only/debugger-only thing.  So even if the atomic_inc()
costs are measurable during these develop/debug sessions, is anyone
likely to care?


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <cl@linux.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
	Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>,
	Jens Axboe <axboe@kernel.dk>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Rik van Riel <riel@redhat.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/9] readahead: add /debug/readahead/stats
Date: Fri, 27 Jan 2012 12:15:51 -0800	[thread overview]
Message-ID: <20120127121551.acd256aa.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1201271006480.16756@router.home>

On Fri, 27 Jan 2012 10:21:36 -0600 (CST)
Christoph Lameter <cl@linux.com> wrote:

> > +
> > +static void readahead_stats_reset(void)
> > +{
> > +	int i, j;
> > +
> > +	for (i = 0; i < RA_PATTERN_ALL; i++)
> > +		for (j = 0; j < RA_ACCOUNT_MAX; j++)
> > +			percpu_counter_set(&ra_stat[i][j], 0);
> 
> for_each_online(cpu)
> 	memset(per_cpu_ptr(&ra_stat, cpu), 0, sizeof(ra_stat));

for_each_possible_cpu().  And that's one reason to not open-code the
operation.  Another is so we don't have tiresome open-coded loops all
over the place.

But before doing either of those things we should choose boring old
atomic_inc().  Has it been shown that the cost of doing so is
unacceptable?  Bearing this in mind:

> The accounting code will be compiled in by default
> (CONFIG_READAHEAD_STATS=y), and will remain inactive by default.

I agree with those choices.  They effectively mean that the stats will
be a developer-only/debugger-only thing.  So even if the atomic_inc()
costs are measurable during these develop/debug sessions, is anyone
likely to care?



  reply	other threads:[~2012-01-27 20:15 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  3:05 [PATCH 0/9] readahead stats/tracing, backwards prefetching and more (v4) Wu Fengguang
2012-01-27  3:05 ` Wu Fengguang
2012-01-27  3:05 ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 1/9] readahead: make context readahead more conservative Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 2/9] readahead: record readahead patterns Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 3/9] readahead: tag mmap page fault call sites Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 4/9] readahead: tag metadata " Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 5/9] readahead: add vfs/readahead tracing event Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 6/9] readahead: add /debug/readahead/stats Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27 16:21   ` Christoph Lameter
2012-01-27 16:21     ` Christoph Lameter
2012-01-27 20:15     ` Andrew Morton [this message]
2012-01-27 20:15       ` Andrew Morton
2012-01-29  5:07       ` Wu Fengguang
2012-01-29  5:07         ` Wu Fengguang
2012-01-30  4:02       ` Dave Chinner
2012-01-30  4:02         ` Dave Chinner
2012-01-27  3:05 ` [PATCH 7/9] readahead: basic support for backwards prefetching Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 8/9] readahead: dont do start-of-file readahead after lseek() Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05 ` [PATCH 9/9] readahead: snap readahead request to EOF Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-01-27  3:05   ` Wu Fengguang
2012-02-09  3:22 ` [PATCH 6/9 update changelog] readahead: add /debug/readahead/stats Wu Fengguang
2012-02-09  3:22   ` Wu Fengguang
  -- strict thread matches above, loose matches on Subject: below --
2012-02-11  4:31 [PATCH 0/9] readahead stats/tracing, backwards prefetching and more (v5) Wu Fengguang
2012-02-11  4:31 ` [PATCH 6/9] readahead: add /debug/readahead/stats Wu Fengguang
2012-02-11  4:31   ` Wu Fengguang
2012-02-11  4:31   ` Wu Fengguang
2011-11-29 13:09 [PATCH 0/9] readahead stats/tracing, backwards prefetching and more (v2) Wu Fengguang
2011-11-29 13:09 ` [PATCH 6/9] readahead: add /debug/readahead/stats Wu Fengguang
2011-11-29 13:09   ` Wu Fengguang
2011-11-29 13:09   ` Wu Fengguang
2011-11-29 15:21   ` Jan Kara
2011-11-29 15:21     ` Jan Kara
2011-11-30  0:44     ` Wu Fengguang
2011-11-30  0:44       ` Wu Fengguang
2011-12-14  6:36     ` Wu Fengguang
2011-12-14  6:36       ` Wu Fengguang
2011-12-19 16:32       ` Jan Kara
2011-12-19 16:32         ` Jan Kara
2011-12-21  1:29         ` Wu Fengguang
2011-12-21  1:29           ` Wu Fengguang
2011-12-21  4:06           ` Dave Chinner
2011-12-21  4:06             ` Dave Chinner
2011-12-23  3:33             ` Wu Fengguang
2011-12-23  3:33               ` Wu Fengguang
2011-12-23 11:16               ` Jan Kara
2011-12-23 11:16                 ` Jan Kara

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=20120127121551.acd256aa.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=axboe@kernel.dk \
    --cc=cl@linux.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.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.