mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: tj@kernel.org
Cc: jack@suse.cz, axboe@fb.com, linux-kernel@vger.kernel.org,
	Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] writeback: Simplify wb_stat_sum
Date: Fri, 23 Jun 2017 18:11:21 +0300	[thread overview]
Message-ID: <1498230681-29103-1-git-send-email-nborisov@suse.com> (raw)

wb_stat_sum disables interrupts and calls __wb_stat_sum which eventually calls
__percpu_counter_sum. However, the percpu routine is already irq-safe. Simplify
the code a bit by making wb_stat_sum directly call percpu_counter_sum_positive
and not disable interrupts. Also remove the now-uneeded __wb_stat_sum which was
just a wrapper over percpu_counter_sum_positive

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 include/linux/backing-dev.h | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index e9c967b86054..854e1bdd0b2a 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -84,22 +84,9 @@ static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
 	return percpu_counter_read_positive(&wb->stat[item]);
 }
 
-static inline s64 __wb_stat_sum(struct bdi_writeback *wb,
-				enum wb_stat_item item)
-{
-	return percpu_counter_sum_positive(&wb->stat[item]);
-}
-
 static inline s64 wb_stat_sum(struct bdi_writeback *wb, enum wb_stat_item item)
 {
-	s64 sum;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	sum = __wb_stat_sum(wb, item);
-	local_irq_restore(flags);
-
-	return sum;
+	return percpu_counter_sum_positive(&wb->stat[item]);
 }
 
 extern void wb_writeout_inc(struct bdi_writeback *wb);
-- 
2.7.4

             reply	other threads:[~2017-06-23 15:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 15:11 Nikolay Borisov [this message]
2017-06-26 20:59 ` Nikolay Borisov

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=1498230681-29103-1-git-send-email-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=axboe@fb.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®