lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGWkznFKg_ONZvkBJUpON=fWwH+rgktCbNOD4rApuiN78D5f9Q@mail.gmail.com>
Date:   Sun, 25 Jul 2021 09:19:06 +0800
From:   Zhaoyang Huang <huangzhaoyang@...il.com>
To:     Minchan Kim <minchan@...nel.org>,
        Zhaoyang Huang <zhaoyang.huang@...soc.com>,
        "open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Nitin Gupta <ngupta@...are.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: [Resend PATCH] driver: zram: fix wrong counting on pages_store

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@...il.com>
X-Mailer: git-send-email 1.7.9.5

From: Zhaoyang Huang <zhaoyang.huang@...soc.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@...soc.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ