From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbdLGIpU (ORCPT ); Thu, 7 Dec 2017 03:45:20 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35690 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbdLGIpQ (ORCPT ); Thu, 7 Dec 2017 03:45:16 -0500 X-Google-Smtp-Source: AGs4zMZ5YGq7JtpoHIdVvtRh5q/BGFesuRR52IQodI4NCbH1aIS0JLH/WPYMulegx7AJU6xzAnry0Q== Date: Thu, 7 Dec 2017 17:45:10 +0900 From: Sergey Senozhatsky To: Gopi Sai Teja Cc: minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, linux-kernel@vger.kernel.org, v.narang@samsung.com, pankaj.m@samsung.com, a.sahrawat@samsung.com, prakash.a@samsung.com, himanshu.sh@samsung.com Subject: Re: [PATCH 1/1] zram: better utilization of zram swap space Message-ID: <20171207084510.GA10341@jagdpanzerIV> References: <1512634963-1079-1-git-send-email-gopi.st@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512634963-1079-1-git-send-email-gopi.st@samsung.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (12/07/17 13:52), Gopi Sai Teja wrote: > If the length of the compressed page is greater than 75% of the PAGE_SIZE, > then the page is stored uncompressed in zram space. Zram space utilization > is improved if the threshold is 80%(5 compressed pages can be stored in > 4 pages). > > If the compressed length is greater than 3068 and less than 3261, pages > still can be stored in compressed form in zs_malloc class 3264. > Currently these compressed pages belong to 4096 zs malloc class. so this makes sense. I had another idea awhile ago lkml.kernel.org/r/1456061274-20059-2-git-send-email-sergey.senozhatsky@gmail.com in short, 3261 is good, but not as good as it possibly can be. for the time being, our huge-class watermark starts at 3264. but this can change. a side note, I think we have sort of wrong API. zsmalloc knows better which object is huge. and who knows, may be we will change the number of huge classes someday or huge-class watermark, etc. so having "hey zsmalloc, is this object huge or not" API seems to be better than ZRAM's enforcement "hey zsmalloc, this object is huge". -ss