From: Tejun Heo <tj@kernel.org>
To: Nikolay Borisov <nborisov@suse.com>
Cc: jbacik@fb.com, jack@suse.cz, linux-kernel@vger.kernel.org,
hannes@cmpxchg.org, mgorman@techsingularity.net
Subject: Re: [PATCH 2/2] writeback: Rework wb_[dec|inc]_stat family of functions
Date: Tue, 20 Jun 2017 13:33:46 -0400 [thread overview]
Message-ID: <20170620173346.GB21326@htj.duckdns.org> (raw)
In-Reply-To: <1497958590-6639-2-git-send-email-nborisov@suse.com>
Hello,
On Tue, Jun 20, 2017 at 02:36:30PM +0300, Nikolay Borisov wrote:
> Currently the writeback statistics code uses a percpu counters to hold
> various statistics. As such we have 2 families of functions - those which
> disable local irq and those which doesn't and whose names are begin with
> double underscore. However, they both end up calling __add_wb_stats which in
> turn end up calling percpu_counter_add_batch which is already SMP-safe.
There's a difference between being SMP-safe and being preemption / irq
save. Even on UP machine, rmw cycles can go wrong due to different
contexts operating on the same memory area, but you're right, all
percpu counter ops are irq safe, so there's no reason for wb stat
operations to have different variants.
> Exploiting this fact allows to eliminated the __wb_* functions since they do
> in fact cal SMP-safe primitive. Furthermore, refactor the wb_* function
> to call __add_wb_stat directly without the irq-disabling dance. This will
> likely result in better runtime of code which deals with modifying the stat
> counters.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> Hello Tejun,
>
> This patch resulted from me reading your feedback on Josef's memory
> throttling prep patch https://patchwork.kernel.org/patch/9395219/ . If these
> changes are merged then his series can eliminated irq clustering and use
> straight __add_wb_stat call. I'd like to see his series merged sooner rather
> than later hence why sending this cleanup.
Sure, but can you please update the patch description?
Thanks.
--
tejun
next prev parent reply other threads:[~2017-06-20 17:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 11:36 [PATCH 1/2] percpu_counter: Rename __percpu_counter_add to percpu_counter_add_batch Nikolay Borisov
2017-06-20 11:36 ` [PATCH 2/2] writeback: Rework wb_[dec|inc]_stat family of functions Nikolay Borisov
2017-06-20 17:33 ` Tejun Heo [this message]
2017-06-20 18:02 ` [PATCH v2 " Nikolay Borisov
2017-06-20 19:37 ` Tejun Heo
2017-06-20 20:28 ` Nikolay Borisov
2017-06-20 20:30 ` Tejun Heo
2017-06-20 20:32 ` Nikolay Borisov
2017-06-21 7:25 ` [PATCH v3] " Nikolay Borisov
2017-06-21 15:59 ` Tejun Heo
2017-06-22 8:38 ` Jan Kara
2017-06-21 0:05 ` [PATCH 2/2] " kbuild test robot
2017-06-20 17:28 ` [PATCH 1/2] percpu_counter: Rename __percpu_counter_add to percpu_counter_add_batch Tejun Heo
2017-06-20 18:01 ` [PATCH v2 " Nikolay Borisov
2017-06-20 19:47 ` [PATCH] " Tejun Heo
2017-06-20 19:55 ` David Miller
2017-06-21 1:14 ` Darrick J. Wong
2017-06-21 12:08 ` David Sterba
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=20170620173346.GB21326@htj.duckdns.org \
--to=tj@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=jbacik@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=nborisov@suse.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