From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747AbcHVIng (ORCPT ); Mon, 22 Aug 2016 04:43:36 -0400 Received: from outboundhk.mxmail.xiaomi.com ([207.226.244.122]:32558 "EHLO xiaomi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754509AbcHVInV (ORCPT ); Mon, 22 Aug 2016 04:43:21 -0400 X-Greylist: delayed 909 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Aug 2016 04:43:13 EDT From: Hui Zhu To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [RFC 0/4] ZRAM: make it just store the high compression rate page Date: Mon, 22 Aug 2016 16:25:05 +0800 Message-ID: <1471854309-30414-1-git-send-email-zhuhui@xiaomi.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.237.10.111] X-ClientProxiedBy: CNCAS3.mioffice.cn (10.237.8.133) To cnbox6.mioffice.cn (10.237.8.146) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current ZRAM just can store all pages even if the compression rate of a page is really low. So the compression rate of ZRAM is out of control when it is running. In my part, I did some test and record with ZRAM. The compression rate is about 40%. This series of patches make ZRAM can just store the page that the compressed size is smaller than a value. With these patches, I set the value to 2048 and did the same test with before. The compression rate is about 20%. The times of lowmemorykiller also decreased. Hui Zhu (4): vmscan.c: shrink_page_list: unmap anon pages after pageout Add non-swap page flag to mark a page will not swap ZRAM: do not swap the pages that compressed size bigger than non_swap vmscan.c: zram: add non swap support for shmem file pages drivers/block/zram/Kconfig | 11 +++ drivers/block/zram/zram_drv.c | 38 +++++++++++ drivers/block/zram/zram_drv.h | 4 + fs/proc/meminfo.c | 6 + include/linux/mm_inline.h | 20 +++++ include/linux/mmzone.h | 3 include/linux/page-flags.h | 8 ++ include/linux/rmap.h | 5 + include/linux/shmem_fs.h | 6 + include/trace/events/mmflags.h | 9 ++ kernel/events/uprobes.c | 16 ++++ mm/Kconfig | 9 ++ mm/memory.c | 34 ++++++++++ mm/migrate.c | 4 + mm/mprotect.c | 8 ++ mm/page_io.c | 11 ++- mm/rmap.c | 23 ++++++ mm/shmem.c | 77 +++++++++++++++++----- mm/vmscan.c | 139 +++++++++++++++++++++++++++++++++++------ 19 files changed, 387 insertions(+), 44 deletions(-)