Received: by 10.223.164.221 with SMTP id h29csp2835839wrb; Wed, 18 Oct 2017 07:44:48 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBJyyTM2kNS/1TrYQGF+ELg0AgUSGJGLVq31VqKpX/dpHQaOvUY8JNKda6ZDreYG9ZQNOPY X-Received: by 10.84.129.70 with SMTP id 64mr15349200plb.287.1508337888592; Wed, 18 Oct 2017 07:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508337888; cv=none; d=google.com; s=arc-20160816; b=HxWBp4OIqGwNQ6zcGNjtDgnfpsAzpEPjXj6kJ5rJCeqq4G/AiI9FJcDVX+fxU2rZ0J 7SV2ou/BUdogK1e7ZOFVeqQa8KEVxKY7EJFOoGEnCRXnVVGR+TqBo0sdBV6mDtLiUWxp VvcIOfBepL2GxYJae92JBj3N2ATivw4iCIzgaRouNyNPcoDiSL1b1LcFOqAUvqlSAVKH wYORLd+czAU8GJqbDRVD/juelneBrIlc4KUvyFtzv0FGHCke7fEQLn5SUK0U40RS20fP is2D8RQSu7tP7jIJmOaq9NvTxRwcLyFa6ybSLDKJTx1bxtVyyJRcGtIG7qwBLHwOxTm/ TDUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:date:message-id:illegal-object :in-reply-to:cc:to:from:reply-to:subject:mime-version :arc-authentication-results; bh=1a+tETx+DRoqpxMpClCQCjWF2ykECeZh3E8vC/VbXAc=; b=cet58BusgShfbqx4aWc+B+il/aL68jDJkXPT0XNYEJOLfkuAslyCk5MTD5LWfvdIbY +nElQeTPOdd7K5+HbfQd+l8mGqojHdokyqWSBYs7uJWO797dUf2F3Olqa2Ttgo/lPv2N 82yztASW+KqOrWz0Idxkn4rkM/k6gFksMu74Uff4iTLNP34DUBbyO31WlesT1EZhel6m w/S7ba+aHW7Jj/tTRI8ROHZWT7DT8KrjjJaOqOdDqVDy9rDx1dKye+AX2frYR9TjxRkJ gRXa4S2vyVbByVfRbMmItVaWxlDgWTIXZqC0SClyfhkjMl4f/q4ikUHv7ew2ZsOVmWwJ smvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si7573838pfq.46.2017.10.18.07.44.34; Wed, 18 Oct 2017 07:44:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751989AbdJROnz (ORCPT + 99 others); Wed, 18 Oct 2017 10:43:55 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:58512 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbdJROnx (ORCPT ); Wed, 18 Oct 2017 10:43:53 -0400 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20171018144351epoutp0192f1295b2338b90c7a0ff0441155b9eb~usUQ994SG0329903299epoutp01T for ; Wed, 18 Oct 2017 14:43:51 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.42.74]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20171018144350epcas5p23d04fd11edf03cce5611d13ddfe2ff27~usUP-5rNQ1919219192epcas5p2L; Wed, 18 Oct 2017 14:43:50 +0000 (GMT) X-AuditID: b6c32a4a-f73ff70000001014-80-59e768a61515 Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id C1.4C.04116.6A867E95; Wed, 18 Oct 2017 23:43:50 +0900 (KST) Mime-Version: 1.0 Subject: Re: [PATCH] zswap: Same-filled pages handling Reply-To: srividya.dr@samsung.com From: Srividya Desireddy To: Matthew Wilcox , Timofey Titovets CC: "sjenning@redhat.com" , "ddstreet@ieee.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "penberg@kernel.org" , Dinakar Reddy Pathireddy , SHARAN ALLUR , RAJIB BASU , JUHUN KIM , "srividya.desireddy@gmail.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20171018141116.GA12063@bombadil.infradead.org> X-Drm-Type: N,general X-EPLocale: en_US.EUC-KR X-EPWebmail-Msg-Type: personal X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Illegal-Object: Syntax error in X-Sender: address found on vger.kernel.org: X-Sender: =?utf-8?B?U2Ftc3VuZyBFbGVjdHJvbmljcxtTUkktQmFuZ2Fs?= ^-Extraneous program text X-Sender-IP: 107.108.50.76 X-Local-Sender: =?UTF-8?B?U3JpdmlkeWEgRGVzaXJlZGR5G1NSSS1CYW5nYWxvcmUtQVAgU3lzdGVt?= =?UTF-8?B?cyAxG++/ve+/veyHse+/veq5hu+/ve+/ve+/ve+/ve+/vRtU?= =?UTF-8?B?ZWNobmljYWwgTGVhZA==?= X-Global-Sender: =?UTF-8?B?U3JpdmlkeWEgRGVzaXJlZGR5G1NSSS1CYW5nYWxvcmUtQVAgU3lzdGVt?= =?UTF-8?B?cyAxG1NhbXN1bmcgRWxlY3Ryb25pY3MbVGVjaG5pY2FsIExl?= =?UTF-8?B?YWQ=?= X-Sender-Code: =?UTF-8?B?QzEwGxtDMTBJRDAxSUQwMTA4OTQ=?= Message-ID: <20171018144350epcms5p1f390fae66f1c9440b8552acec555ca01@epcms5p1> Date: Wed, 18 Oct 2017 14:43:50 +0000 X-CMS-MailID: 20171018144350epcms5p1f390fae66f1c9440b8552acec555ca01 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-CPGSPASS: Y X-CPGSPASS: Y X-MTR: 20171018144350epcms5p1f390fae66f1c9440b8552acec555ca01 CMS-TYPE: 105P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGKsWRmVeSWpSXmKPExsWy7bCmuu6yjOeRBov361m8PKRpcaFtN4vF 7o4TjBanv51mtbi8aw6bxb01/1ktbj9bz2zR9vkfq8Wsn5PYLJYsW8tsseviEzaLczObGS1+ /5jD5sDrsXPWXXaPpxMOMnlsXqHlsWlVJ5vHpk+T2D3e77vK5tG3ZRWjx+dNcgEcUVw2Kak5 mWWpRfp2CVwZDb2n2AsO8lc8e2fcwPidu4uRk0NCwETibf8u5i5GLg4hgd2MEl0v77B0MXJw 8AoISvzdIQxSIyxgJvH9ZhMziC0koCjR3L2BESJuIrHp3wImkHI2ASOJw+dzQMIiAsESM3q7 wEYyC9xilrjf9ZAFYhevxIz2p1C2tMT25VvB5nAK2EicavnNChEXlbi5+i07hC0hsXrhczYI W05i2tc1zDA174/NZ4SwRSRa752FigtKPPi5GypeKdHxeTHUTCmJu98OsIAcJCGwjVFi0uSV TBCJ5YwS9+5AFZlLvH15ECzOK+ArsWzBCbAjWARUJZ4fnAR1tIvE/BkrwWxmAXmJ7W/nMIM8 zyygKbF+lz7Mjw0bf7Njsm0lvqy/ywbRyifR+/sJ0wRG1VmIkJ6FZOgshKELGJlXMUqmFhTn pqcWmxYY5aWW6xUn5haX5qXrJefnbmIEpy4trx2My875HGIU4GBU4uH9ofgsUog1say4MvcQ owQHs5II78yE55FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeY/tLI0UEkhPLEnNTk0tSC2CyTJx cEo1MIoVbvqj4yn3cf9t7gXeT9zOFJ66d+Hjvvezakz/RSaff/yA72qaWPc5NZ4tt2UPb5CY uc9hh9MW61Pv3e7eev9py1b5noyNq6Vzvk8pX3PcfuK5K4XvmZ617Nw2peHYj2WHy9XuXqrn vJrzsn/OyWfbT5hkh+Y8PeU85dnCZz+sZT8UZYmdPWD0UomlOCPRUIu5qDgRADAIsR9ZAwAA X-CMS-RootMailID: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 X-RootMTR: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 References: <20171018141116.GA12063@bombadil.infradead.org> <20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1> <20171018123427.GA7271@bombadil.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 18, 2017 at 7:41 PM, Matthew Wilcox wrote: > On Wed, Oct 18, 2017 at 04:33:43PM +0300, Timofey Titovets wrote: >> 2017-10-18 15:34 GMT+03:00 Matthew Wilcox : >> > On Wed, Oct 18, 2017 at 10:48:32AM +0000, Srividya Desireddy wrote: >> >> +static void zswap_fill_page(void *ptr, unsigned long value) >> >> +{ >> >> + unsigned int pos; >> >> + unsigned long *page; >> >> + >> >> + page = (unsigned long *)ptr; >> >> + if (value == 0) >> >> + memset(page, 0, PAGE_SIZE); >> >> + else { >> >> + for (pos = 0; pos < PAGE_SIZE / sizeof(*page); pos++) >> >> + page[pos] = value; >> >> + } >> >> +} >> > >> > I think you meant: >> > >> > static void zswap_fill_page(void *ptr, unsigned long value) >> > { >> > memset_l(ptr, value, PAGE_SIZE / sizeof(unsigned long)); >> > } >> >> IIRC kernel have special zero page, and if i understand correctly. >> You can map all zero pages to that zero page and not touch zswap completely. >> (Your situation look like some KSM case (i.e. KSM can handle pages >> with same content), but i'm not sure if that applicable there) > >You're confused by the word "same". What Srividya meant was that the >page is filled with a pattern, eg 0xfffefffefffefffe..., not that it is >the same as any other page. In kernel there is a special zero page or empty_zero_page which is in general allocated in paging_init() function, to map all zero pages. But, same-value-filled pages including zero pages exist in memory because applications may be initializing the allocated pages with a value and not using them; or the actual content written to the memory pages during execution itself is same-value, in case of multimedia data for example. I had earlier posted a patch with similar implementaion of KSM concept for Zswap: https://lkml.org/lkml/2016/8/17/171 https://lkml.org/lkml/2017/2/17/612 - Srividya From 1581604945117270088@xxx Wed Oct 18 14:13:34 +0000 2017 X-GM-THRID: 1581603008024215631 X-Gmail-Labels: Inbox,Category Forums