From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f71.google.com (mail-it0-f71.google.com [209.85.214.71]) by kanga.kvack.org (Postfix) with ESMTP id 480D16B0272 for ; Thu, 25 Aug 2016 04:26:12 -0400 (EDT) Received: by mail-it0-f71.google.com with SMTP id f6so26939871ith.3 for ; Thu, 25 Aug 2016 01:26:12 -0700 (PDT) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com. [2607:f8b0:4001:c0b::22f]) by mx.google.com with ESMTPS id j18si16944111ioj.13.2016.08.25.01.26.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 01:26:11 -0700 (PDT) Received: by mail-it0-x22f.google.com with SMTP id x131so258198461ite.0 for ; Thu, 25 Aug 2016 01:26:11 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160825060957.GA568@swordfish> References: <1471854309-30414-1-git-send-email-zhuhui@xiaomi.com> <20160825060957.GA568@swordfish> From: Hui Zhu Date: Thu, 25 Aug 2016 16:25:30 +0800 Message-ID: Subject: Re: [RFC 0/4] ZRAM: make it just store the high compression rate page Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: Hui Zhu , minchan@kernel.org, ngupta@vflare.org, Hugh Dickins , Steven Rostedt , Ingo Molnar , Peter Zijlstra , acme@kernel.org, alexander.shishkin@linux.intel.com, Andrew Morton , mhocko@suse.com, hannes@cmpxchg.org, mgorman@techsingularity.net, vbabka@suse.cz, redkoi@virtuozzo.com, luto@kernel.org, kirill.shutemov@linux.intel.com, geliangtang@163.com, baiyaowei@cmss.chinamobile.com, dan.j.williams@intel.com, vdavydov@virtuozzo.com, aarcange@redhat.com, dvlasenk@redhat.com, jmarchan@redhat.com, koct9i@gmail.com, yang.shi@linaro.org, dave.hansen@linux.intel.com, vkuznets@redhat.com, vitalywool@gmail.com, ross.zwisler@linux.intel.com, Thomas Gleixner , kwapulinski.piotr@gmail.com, axboe@fb.com, mchristi@redhat.com, Joe Perches , namit@vmware.com, Rik van Riel , "linux-kernel@vger.kernel.org" , Linux Memory Management List On Thu, Aug 25, 2016 at 2:09 PM, Sergey Senozhatsky wrote: > Hello, > > On (08/22/16 16:25), Hui Zhu wrote: >> >> 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. > > I haven't looked at the patches in details yet. can you educate me a bit? > is your test stable? why the number of lowmemorykill-s has decreased? > ... or am reading "The times of lowmemorykiller also decreased" wrong? > > suppose you have X pages that result in bad compression size (from zram > point of view). zram stores such pages uncompressed, IOW we have no memory > savings - swapped out page lands in zsmalloc PAGE_SIZE class. now you > don't try to store those pages in zsmalloc, but keep them as unevictable. > so the page still occupies PAGE_SIZE; no memory saving again. why did it > improve LMK? No, zram will not save this page uncompressed with these patches. It will set it as non-swap and kick back to shrink_page_list. Shrink_page_list will remove this page from swapcache and kick it to unevictable list. Then this page will not be swaped before it get write. That is why most of code are around vmscan.c. Thanks, Hui > > -ss -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org