Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbdLFLs5 (ORCPT ); Wed, 6 Dec 2017 06:48:57 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:27841 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751473AbdLFLs4 (ORCPT ); Wed, 6 Dec 2017 06:48:56 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20171206114854epoutp036a17e9d6203f5b62289e3ee9c7408da0~9sifhCrAW3232832328epoutp03P X-AuditID: b6c32a49-915ff7000000117d-7e-5a27d9253f42 Mime-Version: 1.0 Subject: [PATCH v2] zswap: Update with same-value filled page feature Reply-To: srividya.dr@samsung.com From: Srividya Desireddy To: Dan Streetman , "sjenning@redhat.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Srividya Desireddy CC: Dinakar Reddy Pathireddy , RAJIB BASU , Srikanth Mandalapu , SHARAN ALLUR , JUHUN KIM , "srividya.desireddy@gmail.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20171129153437epcms5p64b04efa370cc42bb0f9e5677e298704e@epcms5p6> X-Drm-Type: N,general X-EPWebmail-Msg-Type: personal X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20171206114852epcms5p6973b02a9f455d5d3c765eafda0fe2631@epcms5p6> Date: Wed, 06 Dec 2017 11:48:52 +0000 X-CMS-MailID: 20171206114852epcms5p6973b02a9f455d5d3c765eafda0fe2631 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-CPGSPASS: Y X-CPGSPASS: Y X-MTR: 20171206114852epcms5p6973b02a9f455d5d3c765eafda0fe2631 CMS-TYPE: 105P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKKsWRmVeSWpSXmKPExsWy7bCmpq7qTfUog7/bhC1eHtK0uNC2m8Vi d8cJRovT306zWlzeNYfN4t6a/6wWs35OYrNYsmwts8Wui0/YLBb+v8hocW5mM6PFz29/WR14 PHbOusvu8XTCQSaPTZ8msXu833eVzaNvyypGj8+b5ALYorhsUlJzMstSi/TtErgy1hyRLdgk VHFvfytbA+N2/i5GTg4JAROJ678PMXcxcnEICexmlHh67jpTFyMHB6+AoMTfHcIgNcICrhKn 3z1mBrGFBBQlmrs3MELETSQ2/VsAVs4mYCRx+HwOyBgRgQ+MEvdvz2IFcZgFpjFJtD/5zAqx jFdiRvtTFghbWmL78q2MIM2cAn4SC6+YQ4RFJW6ufssOYctJTPu6hhkm/v7YfEYIW0Si9d5Z qLigxIOfu6HiUhJ3vx1gAdkrIbCNUWLS5JVMEInljBL37kDdYC7x9uVBqB99JZbPcQYJswio Skw98wEsLCHgIrH0fBBImFlAXmL72znMIGFmAU2J9bv0YR5p2PibHZNtK3Hj+CkWiFY+id7f T5hganbMewI1XVXi/yLLCYwqsxDBPAvJrlkIuxYwMq9ilEwtKM5NTy02LTDMSy3XK07MLS7N S9dLzs/dxAhOTFqeOxhnnfM5xCjAwajEwxswQy1KiDWxrLgy9xCjBAezkgjv5cvqUUK8KYmV ValF+fFFpTmpxYcYpTlYlMR5j+0sjRQSSE8sSc1OTS1ILYLJMnFwSjUw6spJLFm8X7u53m+G nYeIc4Z014VJc3s1ZeLC7Hinfp8SNG1Lg++PYuOfJwP8Xjy6u/vumWnlXrcVGl2E1t3b8+z8 qxn3F7KoShxI7buSxiheN+F9dbNZ5sfa/zt5Tx/8svbFdfEpSucELwndPuVg4OZsvD6p9mf2 9QDP4z17T2pym7zZdOlAhxJLcUaioRZzUXEiAP1q1HBIAwAA X-CMS-RootMailID: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 X-RootMTR: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 References: <20171129153437epcms5p64b04efa370cc42bb0f9e5677e298704e@epcms5p6> <20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1> <20171120154648.6c2f96804c4c1668bd8d572a@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2302 Lines: 50 From: Srividya Desireddy Date: Wed, 6 Dec 2017 16:29:50 +0530 Subject: [PATCH v2] zswap: Update with same-value filled page feature Changes since v1: Updated to clarify about zswap.same_filled_pages_enabled parameter. Updated zswap document with details on same-value filled pages identification feature. The usage of zswap.same_filled_pages_enabled module parameter is explained. Signed-off-by: Srividya Desireddy --- Documentation/vm/zswap.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/vm/zswap.txt b/Documentation/vm/zswap.txt index 89fff7d..0b3a114 100644 --- a/Documentation/vm/zswap.txt +++ b/Documentation/vm/zswap.txt @@ -98,5 +98,25 @@ request is made for a page in an old zpool, it is uncompressed using its original compressor. Once all pages are removed from an old zpool, the zpool and its compressor are freed. +Some of the pages in zswap are same-value filled pages (i.e. contents of the +page have same value or repetitive pattern). These pages include zero-filled +pages and they are handled differently. During store operation, a page is +checked if it is a same-value filled page before compressing it. If true, the +compressed length of the page is set to zero and the pattern or same-filled +value is stored. + +Same-value filled pages identification feature is enabled by default and can be +disabled at boot time by setting the "same_filled_pages_enabled" attribute to 0, +e.g. zswap.same_filled_pages_enabled=0. It can also be enabled and disabled at +runtime using the sysfs "same_filled_pages_enabled" attribute, e.g. + +echo 1 > /sys/module/zswap/parameters/same_filled_pages_enabled + +When zswap same-filled page identification is disabled at runtime, it will stop +checking for the same-value filled pages during store operation. However, the +existing pages which are marked as same-value filled pages remain stored +unchanged in zswap until they are either loaded or invalidated. + A debugfs interface is provided for various statistic about pool size, number -of pages stored, and various counters for the reasons pages are rejected. +of pages stored, same-value filled pages and various counters for the reasons +pages are rejected. -- 2.7.4