All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@kernel.dk>
To: Dave Chinner <david@fromorbit.com>
Cc: Nick Piggin <npiggin@gmail.com>, Nick Piggin <npiggin@kernel.dk>,
	linux-fsdevel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] fs: use approximate counter values for inodes and dentries. (was Re: [patch] fs: use fast counters for vfs caches)
Date: Fri, 10 Dec 2010 13:23:58 +1100	[thread overview]
Message-ID: <20101210022358.GB3331@amd> (raw)
In-Reply-To: <20101209233028.GA9925@dastard>

On Fri, Dec 10, 2010 at 10:30:28AM +1100, Dave Chinner wrote:
> On Thu, Dec 09, 2010 at 11:24:38PM +1100, Nick Piggin wrote:
> > No. I was referring to the decision to use the heavyweight percpu_counter
> > code over the superior per cpu data that I was using.
> 
> Your "superior" solution is only superior when you don't have to sum
> the counters regularly.

I was talking about using per cpu variable only for the total counts.
The unused counts would be per-lru (ie. a global variable in this
case).

 
> I'll repeat what Andrew Morton said early one when your per-cpu
> counter approach was first discussed: If you think the generic
> percpu counters are too heavyweight, then _fix the generic counters_
> rather than hack around them. That way everyone who uses the generic
> infrastructure benefits and it reduces the desire for every subsystem
> to roll their own specialised percpu counters...

So why was the percpu_counter patch merged without addressing *my*
concern that it is too heavyweight? Hmm?


> > Also, the unrelated change to make nr_unused into per-cpu was not
> > right, and I will revert that back to a global variable. (again, unless you
> > have numbers)
> 
> What "nr_unused" variable? nr_dentrys_unused, nr_inodes_unused or
> some other variable? And, apart from the overhead, why is it wrong -
> does it give incorrect values?

It's wrong because it is tied completely to lru operation and can't
be at all scalable anyway. I said that in this thread already, there
is no point adding overhead of per cpu counter for operations that
are done under a lock anyway.

 
> > > It certainly wasn't measurable on my
> > > 16p machine, and nobody who reviewed it at the time (ѕeveral people)
> > > picked it up. So thanks for reviewing it - the simple fix is below.
> > >
> > > Cheers,
> > >
> > > Dave.
> > > --
> > > Dave Chinner
> > > david@fromorbit.com
> > >
> > > fs: Use approximate values for number of inodes and dentries
> > >
> > > From: Dave Chinner <dchinner@redhat.com>
> > 
> > Nack. Can you please address my points and actually explain why this
> > is better than my proposed approach please?
> 
> FFS. What bit of "need to sum the counters thousands of times a
> second" don't you understand?

The part where reclaim only sums the nr_unused counter, which I
said should not be per cpu.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" 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:[~2010-12-10  2:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 10:57 [patch] fs: use fast counters for vfs caches Nick Piggin
2010-12-09  5:43 ` Dave Chinner
2010-12-09  6:16   ` Nick Piggin
2010-12-09  6:40     ` Nick Piggin
2010-12-10  4:51       ` [patch 1/2] fs: revert percpu nr_unused counters for dentry and inodes Nick Piggin
2010-12-10  4:55         ` [patch 2/2] fs: use fast counters for vfs caches Nick Piggin
2010-12-09  7:45     ` [PATCH] fs: use approximate counter values for inodes and dentries. (was Re: [patch] fs: use fast counters for vfs caches) Dave Chinner
2010-12-09 12:24       ` Nick Piggin
2010-12-09 23:30         ` Dave Chinner
2010-12-10  2:23           ` Nick Piggin [this message]

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=20101210022358.GB3331@amd \
    --to=npiggin@kernel.dk \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.