From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03EF6C47092 for ; Sun, 30 May 2021 17:18:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7536461090 for ; Sun, 30 May 2021 17:18:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7536461090 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8F4476B0036; Sun, 30 May 2021 13:18:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B9C76B006E; Sun, 30 May 2021 13:18:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70B328D0001; Sun, 30 May 2021 13:18:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id BC47A6B0036 for ; Sun, 30 May 2021 13:18:25 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 60C596123 for ; Sun, 30 May 2021 17:18:25 +0000 (UTC) X-FDA: 78198556170.10.3D691B6 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by imf22.hostedemail.com (Postfix) with ESMTP id 7FE86C00CBE0 for ; Sun, 30 May 2021 17:18:14 +0000 (UTC) Received: by mail-ed1-f48.google.com with SMTP id r11so10690161edt.13 for ; Sun, 30 May 2021 10:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fAd0hVaA74OSQdKN0EHRoTSGMD/QMCML6zHEFr+ju5g=; b=AnfFKOroA0Nc5N3ZThPjHkpsp3VLz5PA9vQYOE7O+lXhNwW4xsxqqUexRWjpxL9dx1 YCu/vdyZGdWrO36SLsblcZvCAP2vhTmdAu/4jVJL4tMe0m/pEKrn9UN4YJ8RcwzZ2ytE A5PylvlPnh+TL35XWtYWTNM1k4prsbQXz5rG7QdkENyjA77opUCCFwQB8x7UY6Tq6gzf VKxkjnUe1IKkdOxM4CgC4whPr0umhCAPIgruaVTgpIdtfbbvxMFkbUwd5PT3mD/xlTK1 chZsCrDxkGfU1VahKw9N5WttAkR5X63jOwpCYP1WA5JLq7XVybULR4qyz3RTierNBeG5 wD4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fAd0hVaA74OSQdKN0EHRoTSGMD/QMCML6zHEFr+ju5g=; b=Uasclx6j4nvtnFlArCdWSQpxtURZiQdq5vkdo5yH+0dyTLtOtOfxQuCBfJtMZilGPk KSv+IPEyYPamGLyDMlVu5+57iZXNKQL/AdSB/mjjcpWkBA/xVLWYp4mt0ppExoeanP6e WrHQqEQ/+wpac1xFbYZaX7k+/i/Nd32dMZ8g4ODuiGRTKFsfXhq44Fdz3NiByBbMOJmy iF/ad6catfR8dqNrMcYqFhj8ygK0v675gls/IXJL51ptbaOcek40+w/ad5N5I9Ygl6yD PL7ujBgqf0HlY5P53V1v9mKKrb8iT7koTB/Ay1ooj9WYS7Zgb3VTtkGSsAlX6FLO4G/x p9vA== X-Gm-Message-State: AOAM5322qKtZjwhFjukJBIt3xJyWI1wCem+zgMpXDaQ/bS1ko6ObOj6Y mzOlamMrERYpmIbFzOr0hwB3LDTy0wTyVaJ1WYs= X-Google-Smtp-Source: ABdhPJzd0pN1sFF2JWgSTE6LRk9KIXGEL2TeQNOAa+F05oReWh6qzpQVhXzBK28rE8P2GkWuOD4zooA2JKeMFbTbouQ= X-Received: by 2002:aa7:c787:: with SMTP id n7mr21300495eds.309.1622395103838; Sun, 30 May 2021 10:18:23 -0700 (PDT) MIME-Version: 1.0 From: yong w Date: Mon, 31 May 2021 01:18:12 +0800 Message-ID: Subject: [RFC PATCH V1] zram:calculate available memory when zram is used To: minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, axboe@kernel.dk, akpm@linux-foundation.org, songmuchun@bytedance.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org Content-Type: multipart/alternative; boundary="000000000000d9864605c38f4be3" Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=AnfFKOro; spf=pass (imf22.hostedemail.com: domain of yongwpur@gmail.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=yongwpur@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7FE86C00CBE0 X-Stat-Signature: 5gmuet7iojoyt3pkdpi3zu8jotjirhcq X-HE-Tag: 1622395094-153088 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000d9864605c38f4be3 Content-Type: text/plain; charset="UTF-8" When zram is used, available+Swap free memory is obviously bigger than I actually can use, because zram can compress memory by compression algorithm and zram compressed data will occupy memory too. So, I count the compression rate of zram in the kernel. The available memory is calculated as follows: available + swapfree - swapfree * compress ratio MemAvailable in /proc/meminfo returns available + zram will save space Signed-off-by: wangyong --- drivers/block/zram/zcomp.h | 1 + drivers/block/zram/zram_drv.c | 4 ++ drivers/block/zram/zram_drv.h | 1 + fs/proc/meminfo.c | 2 +- include/linux/swap.h | 10 +++++ mm/swapfile.c | 95 +++++++++++++++++++++++++++++++++++++++++++ mm/vmscan.c | 1 + 7 files changed, 113 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h index 40f6420..deb2dbf 100644 --- a/drivers/block/zram/zcomp.h +++ b/drivers/block/zram/zcomp.h @@ -40,4 +40,5 @@ int zcomp_decompress(struct zcomp_strm *zstrm, const void *src, unsigned int src_len, void *dst); bool zcomp_set_max_streams(struct zcomp *comp, int num_strm); +int get_zram_major(void); #endif /* _ZCOMP_H_ */ diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index cf8deec..1c6cbd4 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -59,6 +59,10 @@ static void zram_free_page(struct zram *zram, size_t index); static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, u32 index, int offset, struct bio *bio); +int get_zram_major(void) +{ + return zram_major; +} static int zram_slot_trylock(struct zram *zram, u32 index) { diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index 6e73dc3..5d8701a 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -88,6 +88,7 @@ struct zram_stats { atomic64_t bd_reads; /* no. of reads from backing device */ atomic64_t bd_writes; /* no. of writes from backing device */ #endif + atomic_t min_compr_ratio; }; struct zram { diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 6fa761c..f7bf350 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -57,7 +57,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) show_val_kb(m, "MemTotal: ", i.totalram); show_val_kb(m, "MemFree: ", i.freeram); - show_val_kb(m, "MemAvailable: ", available); + show_val_kb(m, "MemAvailable: ", available + count_avail_swaps()); show_val_kb(m, "Buffers: ", i.bufferram); show_val_kb(m, "Cached: ", cached); show_val_kb(m, "SwapCached: ", total_swapcache_pages()); diff --git a/include/linux/swap.h b/include/linux/swap.h index 032485e..3225a2f 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -514,6 +514,8 @@ extern int init_swap_address_space(unsigned int type, unsigned long nr_pages); extern void exit_swap_address_space(unsigned int type); extern struct swap_info_struct *get_swap_device(swp_entry_t entry); sector_t swap_page_sector(struct page *page); +extern void update_zram_zstats(void); +extern u64 count_avail_swaps(void); static inline void put_swap_device(struct swap_info_struct *si) { @@ -684,6 +686,14 @@ static inline swp_entry_t get_swap_page(struct page *page) return entry; } +void update_zram_zstats(void) +{ +} + +u64 count_avail_swaps(void) +{ +} + #endif /* CONFIG_SWAP */ #ifdef CONFIG_THP_SWAP diff --git a/mm/swapfile.c b/mm/swapfile.c index cbb4c07..93a9dcb 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -44,6 +44,7 @@ #include #include #include +#include "../drivers/block/zram/zram_drv.h" static bool swap_count_continued(struct swap_info_struct *, pgoff_t, unsigned char); @@ -3408,6 +3409,100 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) return error; } +u64 count_avail_swap(struct swap_info_struct *si) +{ + u64 result; + struct zram *z; + unsigned int free; + unsigned int ratio; + + result = 0; + if (!si) + return 0; + + //zram calculate available mem + if (si->flags & SWP_USED && si->swap_map) { + if (si->bdev->bd_disk->major == get_zram_major()) { + z = (struct zram *)si->bdev->bd_disk->private_data; + down_read(&z->init_lock); + ratio = atomic_read(&z->stats.min_compr_ratio); + free = (si->pages << (PAGE_SHIFT - 10)) + - (si->inuse_pages << (PAGE_SHIFT - 10)); + if (!ratio) + result += free / 2; + else + result = free * (100 - 10000 / ratio) / 100; + up_read(&z->init_lock); + } + } else + result += (si->pages << (PAGE_SHIFT - 10)) + - (si->inuse_pages << (PAGE_SHIFT - 10)); + + return result; +} + +u64 count_avail_swaps(void) +{ + int type; + u64 result; + struct swap_info_struct *si; + + result = 0; + spin_lock(&swap_lock); + for (type = 0; type < nr_swapfiles; type++) { + si = swap_info[type]; + spin_lock(&si->lock); + result += count_avail_swap(si); + spin_unlock(&si->lock); + } + spin_unlock(&swap_lock); + + return result; +} + +void update_zram_zstat(struct swap_info_struct *si) +{ + struct zram *z; + struct zram_stats *stat; + int ratio; + u64 orig_size, compr_data_size; + + if (!si) + return; + + //update zram min compress ratio + if (si->flags & SWP_USED && si->swap_map) { + if (si->bdev->bd_disk->major == get_zram_major()) { + z = (struct zram *)si->bdev->bd_disk->private_data; + down_read(&z->init_lock); + stat = &z->stats; + ratio = atomic_read(&stat->min_compr_ratio); + orig_size = atomic64_read(&stat->pages_stored) << PAGE_SHIFT; + compr_data_size = atomic64_read(&stat->compr_data_size); + if (compr_data_size && (!ratio + || ((orig_size * 100) / compr_data_size < ratio))) + atomic_set(&stat->min_compr_ratio, + (orig_size * 100) / compr_data_size); + up_read(&z->init_lock); + } + } +} + +void update_zram_zstats(void) +{ + int type; + struct swap_info_struct *si; + + spin_lock(&swap_lock); + for (type = 0; type < nr_swapfiles; type++) { + si = swap_info[type]; + spin_lock(&si->lock); + update_zram_zstat(si); + spin_unlock(&si->lock); + } + spin_unlock(&swap_lock); +} + void si_swapinfo(struct sysinfo *val) { unsigned int type; diff --git a/mm/vmscan.c b/mm/vmscan.c index eb31452..ffaf59b 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4159,6 +4159,7 @@ static int kswapd(void *p) alloc_order); reclaim_order = balance_pgdat(pgdat, alloc_order, highest_zoneidx); + update_zram_zstats(); if (reclaim_order < alloc_order) goto kswapd_try_sleep; } -- 2.7.4 --000000000000d9864605c38f4be3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When zram is used, available+Swap free memory is obviously= bigger than
I actually can use, because zram can compress memory by com= pression
algorithm and zram compressed data will occupy memory too.
<= br>So, I count the compression rate of zram in the kernel. The availablememory =C2=A0is calculated as follows:
available + swapfree - swapfree = * compress ratio
MemAvailable in /proc/meminfo returns available + zram = will save space

Signed-off-by: wangyong <yongw.pur@gmail.com>
---
=C2=A0drivers/block/zr= am/zcomp.h =C2=A0 =C2=A0| =C2=A01 +
=C2=A0drivers/block/zram/zram_drv.c = | =C2=A04 ++
=C2=A0drivers/block/zram/zram_drv.h | =C2=A01 +
=C2=A0fs= /proc/meminfo.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A02 +-
= =C2=A0include/linux/swap.h =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 10 +++++
= =C2=A0mm/swapfile.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= | 95 +++++++++++++++++++++++++++++++++++++++++++
=C2=A0mm/vmscan.c =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A01 +
= =C2=A07 files changed, 113 insertions(+), 1 deletion(-)

diff --git a= /drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h
index 40f6420..= deb2dbf 100644
--- a/drivers/block/zram/zcomp.h
+++ b/drivers/block/z= ram/zcomp.h
@@ -40,4 +40,5 @@ int zcomp_decompress(struct zcomp_strm *zs= trm,
=C2=A0 const void *src, unsigned int src_len, void *dst);
=C2=A0=
=C2=A0bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
= +int get_zram_major(void);
=C2=A0#endif /* _ZCOMP_H_ */
diff --git a/= drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index cf8d= eec..1c6cbd4 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers= /block/zram/zram_drv.c
@@ -59,6 +59,10 @@ static void zram_free_page(str= uct zram *zram, size_t index);
=C2=A0static int zram_bvec_read(struct zr= am *zram, struct bio_vec *bvec,
=C2=A0 u32 index, int offset, struct bio= *bio);
=C2=A0
+int get_zram_major(void)
+{
+ return zram_major= ;
+}
=C2=A0
=C2=A0static int zram_slot_trylock(struct zram *zram, = u32 index)
=C2=A0{
diff --git a/drivers/block/zram/zram_drv.h b/drive= rs/block/zram/zram_drv.h
index 6e73dc3..5d8701a 100644
--- a/drivers/= block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -88,6 +8= 8,7 @@ struct zram_stats {
=C2=A0 atomic64_t bd_reads; /* no. of reads f= rom backing device */
=C2=A0 atomic64_t bd_writes; /* no. of writes from= backing device */
=C2=A0#endif
+ atomic_t min_compr_ratio;
=C2=A0= };
=C2=A0
=C2=A0struct zram {
diff --git a/fs/proc/meminfo.c b/fs/= proc/meminfo.c
index 6fa761c..f7bf350 100644
--- a/fs/proc/meminfo.c<= br>+++ b/fs/proc/meminfo.c
@@ -57,7 +57,7 @@ static int meminfo_proc_sho= w(struct seq_file *m, void *v)
=C2=A0
=C2=A0 show_val_kb(m, "Mem= Total: =C2=A0 =C2=A0 =C2=A0 ", i.totalram);
=C2=A0 show_val_kb(m, &= quot;MemFree: =C2=A0 =C2=A0 =C2=A0 =C2=A0", i.freeram);
- show_val_= kb(m, "MemAvailable: =C2=A0 ", available);
+ show_val_kb(m, &q= uot;MemAvailable: =C2=A0 ", available + count_avail_swaps());
=C2= =A0 show_val_kb(m, "Buffers: =C2=A0 =C2=A0 =C2=A0 =C2=A0", i.buff= erram);
=C2=A0 show_val_kb(m, "Cached: =C2=A0 =C2=A0 =C2=A0 =C2=A0 = ", cached);
=C2=A0 show_val_kb(m, "SwapCached: =C2=A0 =C2=A0 &= quot;, total_swapcache_pages());
diff --git a/include/linux/swap.h b/inc= lude/linux/swap.h
index 032485e..3225a2f 100644
--- a/include/linux/s= wap.h
+++ b/include/linux/swap.h
@@ -514,6 +514,8 @@ extern int init_= swap_address_space(unsigned int type, unsigned long nr_pages);
=C2=A0ext= ern void exit_swap_address_space(unsigned int type);
=C2=A0extern struct= swap_info_struct *get_swap_device(swp_entry_t entry);
=C2=A0sector_t sw= ap_page_sector(struct page *page);
+extern void update_zram_zstats(void)= ;
+extern u64 count_avail_swaps(void);
=C2=A0
=C2=A0static inline = void put_swap_device(struct swap_info_struct *si)
=C2=A0{
@@ -684,6 += 686,14 @@ static inline swp_entry_t get_swap_page(struct page *page)
=C2= =A0 return entry;
=C2=A0}
=C2=A0
+void update_zram_zstats(void)+{
+}
+
+u64 count_avail_swaps(void)
+{
+}
+
=C2=A0#e= ndif /* CONFIG_SWAP */
=C2=A0
=C2=A0#ifdef CONFIG_THP_SWAP
diff --= git a/mm/swapfile.c b/mm/swapfile.c
index cbb4c07..93a9dcb 100644
---= a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -44,6 +44,7 @@
=C2=A0#incl= ude <asm/tlbflush.h>
=C2=A0#include <linux/swapops.h>
=C2= =A0#include <linux/swap_cgroup.h>
+#include "../drivers/block= /zram/zram_drv.h"
=C2=A0
=C2=A0static bool swap_count_continued(= struct swap_info_struct *, pgoff_t,
=C2=A0 unsigned char);
@@ -3408,6= +3409,100 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int= , swap_flags)
=C2=A0 return error;
=C2=A0}
=C2=A0
+u64 count_av= ail_swap(struct swap_info_struct *si)
+{
+ u64 result;
+ struct zr= am *z;
+ unsigned int free;
+ unsigned int ratio;
+
+ result = =3D 0;
+ if (!si)
+ return 0;
+
+ //zram calculate available me= m
+ if (si->flags & SWP_USED && si->swap_map) {
+ i= f (si->bdev->bd_disk->major =3D=3D get_zram_major()) {
+ z =3D = (struct zram *)si->bdev->bd_disk->private_data;
+ down_read(&am= p;z->init_lock);
+ ratio =3D atomic_read(&z->stats.min_compr_r= atio);
+ free =3D (si->pages << (PAGE_SHIFT - 10))
+ - (si-&= gt;inuse_pages << (PAGE_SHIFT - 10));
+ if (!ratio)
+ result += =3D free / 2;
+ else
+ result =3D free * (100 - 10000 / ratio) / 100;=
+ up_read(&z->init_lock);
+ }
+ } else
+ result +=3D (s= i->pages << (PAGE_SHIFT - 10))
+ - (si->inuse_pages <<= (PAGE_SHIFT - 10));
+
+ return result;
+}
+
+u64 count_avai= l_swaps(void)
+{
+ int type;
+ u64 result;
+ struct swap_info_s= truct *si;
+
+ result =3D 0;
+ spin_lock(&swap_lock);
+ for= (type =3D 0; type < nr_swapfiles; type++) {
+ si =3D swap_info[type]= ;
+ spin_lock(&si->lock);
+ result +=3D count_avail_swap(si);<= br>+ spin_unlock(&si->lock);
+ }
+ spin_unlock(&swap_lock)= ;
+
+ return result;
+}
+
+void update_zram_zstat(struct swa= p_info_struct *si)
+{
+ struct zram *z;
+ struct zram_stats *stat;=
+ int ratio;
+ u64 orig_size, compr_data_size;
+
+ if (!si)+ return;
+
+ //update zram min compress ratio
+ if (si->flags= & SWP_USED && si->swap_map) {
+ if (si->bdev->bd_d= isk->major =3D=3D get_zram_major()) {
+ z =3D (struct zram *)si->b= dev->bd_disk->private_data;
+ down_read(&z->init_lock);
= + stat =3D &z->stats;
+ ratio =3D atomic_read(&stat->min_c= ompr_ratio);
+ orig_size =3D atomic64_read(&stat->pages_stored) &= lt;< PAGE_SHIFT;
+ compr_data_size =3D atomic64_read(&stat->co= mpr_data_size);
+ if (compr_data_size && (!ratio
+ =C2=A0 =C2= =A0 || ((orig_size * 100) / compr_data_size < ratio)))
+ atomic_set(&= amp;stat->min_compr_ratio,
+ =C2=A0 =C2=A0(orig_size * 100) / compr_d= ata_size);
+ up_read(&z->init_lock);
+ }
+ }
+}
+
= +void update_zram_zstats(void)
+{
+ int type;
+ struct swap_info_s= truct *si;
+
+ spin_lock(&swap_lock);
+ for (type =3D 0; type = < nr_swapfiles; type++) {
+ si =3D swap_info[type];
+ spin_lock(&a= mp;si->lock);
+ update_zram_zstat(si);
+ spin_unlock(&si->l= ock);
+ }
+ spin_unlock(&swap_lock);
+}
+
=C2=A0void si_= swapinfo(struct sysinfo *val)
=C2=A0{
=C2=A0 unsigned int type;
di= ff --git a/mm/vmscan.c b/mm/vmscan.c
index eb31452..ffaf59b 100644
--= - a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4159,6 +4159,7 @@ static int ks= wapd(void *p)
=C2=A0 alloc_order);
=C2=A0 reclaim_order =3D balance_p= gdat(pgdat, alloc_order,
=C2=A0 highest_zoneidx);
+ update_zram_zstat= s();
=C2=A0 if (reclaim_order < alloc_order)
=C2=A0 goto kswapd_tr= y_sleep;
=C2=A0 }
--
2.7.4
--000000000000d9864605c38f4be3--