From: Waiman Long <waiman.long@hpe.com>
To: Tejun Heo <tj@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Christoph Lameter <cl@linux.com>, <linux-ext4@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Scott J Norton <scott.norton@hpe.com>,
Douglas Hatch <doug.hatch@hpe.com>,
Toshimitsu Kani <toshi.kani@hpe.com>
Subject: Re: [PATCH v2 2/4] percpu_stats: Enable 64-bit counts in 32-bit architectures
Date: Fri, 8 Apr 2016 14:45:38 -0400 [thread overview]
Message-ID: <5707FC52.3070707@hpe.com> (raw)
In-Reply-To: <20160408174628.GN24661@htj.duckdns.org>
On 04/08/2016 01:46 PM, Tejun Heo wrote:
> Hello,
>
> On Fri, Apr 08, 2016 at 01:32:52PM -0400, Waiman Long wrote:
>> Yes, I think it will be more efficient to use percpu_counter in this case.
>> The preempt_disable/enable() calls are pretty cheap. Once in a while, you
>> need to take the lock and update the global count. How about I change the
>> 2nd patch to use percpu_counter internally when 64-bit counts are needed in
>> 32-bit archs, but use the regular percpu counts on 64-bit archs? If you are
>> OK with that, I can update the patch accordingly.
> Does having percpu_stats as a separate construct make sense after
> that? Just use percpu_counter directly? You end up wasting a bit
> more space that way but most of space overhead for these things are in
> percpu part anyway, so in proportion it shouldn't make that much of a
> difference.
>
> Thanks.
>
The percpu_stats construct allows minimal overhead in maintaining
statistics counts. The percpu_counter construct, on the other hand, has
a higher performance overhead and a bit more complex to set up and tear
down when more than one statistics counts are needed. In fact, my first
draft of the ext4 patch used percpu_counter for that purpose. However, I
just feel that using percpu_counter is kind of an overkill if what we
just want is to keep some counts that we want to have their sums
returned when requested. That are the main reasons for creating a
separate percpu_stats.
Of course, if you think we don't need a separate percpu_stats construct.
I am fine with that and I can rework the ext4 patch to use
percpu_counter instead.
Cheers,
Longman
next prev parent reply other threads:[~2016-04-08 18:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 16:16 [PATCH v2 0/4] ext4: Improve parallel I/O performance on NVDIMM Waiman Long
2016-04-08 16:16 ` [PATCH v2 1/4] percpu_stats: Simple per-cpu statistics count helper functions Waiman Long
2016-04-08 16:49 ` kbuild test robot
2016-04-08 17:45 ` kbuild test robot
2016-04-08 16:16 ` [PATCH v2 2/4] percpu_stats: Enable 64-bit counts in 32-bit architectures Waiman Long
2016-04-08 16:47 ` Tejun Heo
2016-04-08 17:32 ` Waiman Long
2016-04-08 17:46 ` Tejun Heo
2016-04-08 18:45 ` Waiman Long [this message]
2016-04-11 22:17 ` Tejun Heo
2016-04-12 18:15 ` Waiman Long
2016-04-08 16:16 ` [PATCH v2 3/4] ext4: Pass in DIO_SKIP_DIO_COUNT flag if inode_dio_begin() called Waiman Long
2016-04-08 16:16 ` [PATCH v2 4/4] ext4: Make cache hits/misses per-cpu counts Waiman Long
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=5707FC52.3070707@hpe.com \
--to=waiman.long@hpe.com \
--cc=adilger.kernel@dilger.ca \
--cc=cl@linux.com \
--cc=doug.hatch@hpe.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=scott.norton@hpe.com \
--cc=tj@kernel.org \
--cc=toshi.kani@hpe.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 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).