All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Minchan Kim <minchan@kernel.org>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Nitin Gupta <ngupta@vflare.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: [Resend PATCH] driver: zram: fix wrong counting on pages_store
Date: Sun, 25 Jul 2021 09:19:06 +0800	[thread overview]
Message-ID: <CAGWkznFKg_ONZvkBJUpON=fWwH+rgktCbNOD4rApuiN78D5f9Q@mail.gmail.com> (raw)
In-Reply-To: <1626763658-27748-1-git-send-email-huangzhaoyang@gmail.com>

Subject: [PATCH] driver: zram: fix wrong counting on pages_store
Date: Tue, 20 Jul 2021 14:47:38 +0800
Message-Id: <1626763658-27748-1-git-send-email-huangzhaoyang@gmail.com>
X-Mailer: git-send-email 1.7.9.5

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

It makes the statistic confused when counting pages_store in during writeback.
pages_store should just reflect the swapped pages on ZRAM, while bd_writes be
responsible for writeback things.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
 drivers/block/zram/zram_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index cf8deec..6bdaa9d 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -765,7 +765,6 @@ static ssize_t writeback_store(struct device *dev,
  zram_set_flag(zram, index, ZRAM_WB);
  zram_set_element(zram, index, blk_idx);
  blk_idx = 0;
- atomic64_inc(&zram->stats.pages_stored);
  spin_lock(&zram->wb_limit_lock);
  if (zram->wb_limit_enable && zram->bd_wb_limit > 0)
  zram->bd_wb_limit -=  1UL << (PAGE_SHIFT - 12);
-- 
1.9.1

  reply	other threads:[~2021-07-25  1:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  6:47 [PATCH] driver: zram: fix wrong counting on pages_store Huangzhaoyang
2021-07-25  1:19 ` Zhaoyang Huang [this message]
2021-07-25  1:19   ` [Resend PATCH] " Zhaoyang Huang
2021-07-26  1:27 ` [PATCH] " Sergey Senozhatsky
2021-07-26 17:53   ` Minchan Kim
2021-07-27  1:32     ` Zhaoyang Huang
2021-07-27  1:32       ` Zhaoyang Huang
2021-07-27  5:45       ` Zhaoyang Huang
2021-07-27  5:45         ` Zhaoyang Huang

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='CAGWkznFKg_ONZvkBJUpON=fWwH+rgktCbNOD4rApuiN78D5f9Q@mail.gmail.com' \
    --to=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=senozhatsky@chromium.org \
    --cc=zhaoyang.huang@unisoc.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.