Received: by 10.223.164.221 with SMTP id h29csp2257356wrb; Thu, 2 Nov 2017 08:10:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q+JBbN0jJ1130+vpE6ullhbRp3hsKWNss6cRosVCHPy9oSorJ3ULO63c98nxElmm0TOnyh X-Received: by 10.99.64.5 with SMTP id n5mr3879776pga.244.1509635408479; Thu, 02 Nov 2017 08:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509635408; cv=none; d=google.com; s=arc-20160816; b=o1QTFVK+VzdWHJxp+tfK/SyXG/w8vK63jcq6INLeocxoMdmqkuGsj1BRawtQ9O7S0o Eh9Oq+6/8pfmiPs7Td8/xmpoWQDD0dHRoophQq82tjV/zrhmKv+AOEufkqqYfBzvTIwF 3q/cjUNz/9vtPZFeuhzD6YpueIImvIw6QL9qxjiE+ssgGu0GKf5YdALqNk9jUVIjWGpR H26LjFn8pFxl0cyiru+6jwNxHsi2ewjZZZ+qQqnilsatdyxsFAt7aGaB7yijLuhvMaZ5 ZfpVFmNhOeBmQITbUrCNFbrCfvn0Ig4VDWM/dcGj+HNuWtnXgiXpleCw5xOpj6AAMwOV 9EmQ== 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:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=iz2JdfrfTnkzMu5LR37NRlKxVcTIQghGU4fsVjiq92k=; b=WXfNm5U0rCHSe1+MvZBgU7sTUWoHKY+2/93EpZ0BsE1UMuTpGtCpgp/GVInHDChMUS Q5I5AsC0bFa45B4qbh5R1aRvVxr4XIwOjnyJsh25yh1Zb8VKJgUsFkSkmxdEMUkTiDzZ r7LiM5CV2+8/QvSp3bzVMcH/+DEVrtqETAAJeH2fx/C3+298jPH4picGsUGOY5O5NAle GmCAneR1t8bEAKmsYGJPMjsQds7KOGze+Bw08L7Okqqlv5x3l76UvDfemD+fFoBAXj0Z /W/y7zrknlkFwJ31r/mnz8jyG8FA+QpWbc8V0KMMBSmHvitzNrDayJAGSwYaFPDuPQkF MVqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TksIpjiW; 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=pass (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 102si2464537plb.676.2017.11.02.08.09.54; Thu, 02 Nov 2017 08:10:08 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TksIpjiW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933761AbdKBPIZ (ORCPT + 97 others); Thu, 2 Nov 2017 11:08:25 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:30289 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933540AbdKBPIX (ORCPT ); Thu, 2 Nov 2017 11:08:23 -0400 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20171102150821epoutp03d05ce81c345f42b28e1b3223911b27ec~zTU76Gnl02640926409epoutp03n for ; Thu, 2 Nov 2017 15:08:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20171102150821epoutp03d05ce81c345f42b28e1b3223911b27ec~zTU76Gnl02640926409epoutp03n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1509635301; bh=iz2JdfrfTnkzMu5LR37NRlKxVcTIQghGU4fsVjiq92k=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=TksIpjiWp+ijCTFKP6No01qdKbh7V1MpqDlvt+CAVPNdQ+gwMmhL3tt2/VtfYzZ91 eDhvNSr9U6umMtJkCHcsXWy1lD1dbCFr6ychjv1wk8EDCK9Ep3UJn+rhSZy6EP7Fw8 fuIUFoOmP1W+ViNp+8SnLL5OJNQUo4Ig+1aZlFVg= Received: from epsmges5p3new.samsung.com (unknown [182.195.42.75]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20171102150821epcas5p4831c72d4c032c56ca20ad76a256577ff~zTU7cPgNh0797307973epcas5p4I; Thu, 2 Nov 2017 15:08:21 +0000 (GMT) X-AuditID: b6c32a4b-eebff70000001126-dc-59fb34e5b01d Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 74.E2.04390.5E43BF95; Fri, 3 Nov 2017 00:08:21 +0900 (KST) Mime-Version: 1.0 Subject: Re: [PATCH] zswap: Same-filled pages handling Reply-To: srividya.dr@samsung.com From: Srividya Desireddy To: "sjenning@redhat.com" , Matthew Wilcox , Timofey Titovets CC: "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: <20171019010841.GA17308@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 Message-ID: <20171102150820epcms5p307052ef7697592b3b4e2848bf4968f7b@epcms5p3> Date: Thu, 02 Nov 2017 15:08:20 +0000 X-CMS-MailID: 20171102150820epcms5p307052ef7697592b3b4e2848bf4968f7b Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-CPGSPASS: Y X-CPGSPASS: Y X-MTR: 20171102150820epcms5p307052ef7697592b3b4e2848bf4968f7b CMS-TYPE: 105P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLKsWRmVeSWpSXmKPExsWy7bCmhu5Tk9+RBlsWs1q8PKRpsbvjBKPF 6W+nWS0u75rDZnFvzX9Wi9vP1jNbtH3+x2ox6+ckNosly9YyW+y6+ITN4tzMZkaL3z/msDnw eOycdZfdY/MKLY9NqzrZPDZ9msTu8X7fVTaPvi2rGD0+b5ILYI/isklJzcksSy3St0vgyjiz TahgF3vFsdUbWRoYl7B2MXJySAiYSGyZuo2li5GLQ0hgN6PErmXP2boYOTh4BQQl/u4QBqkR FjCT+H6ziRnEFhJQlGju3sAIETeR2PRvARNIOZuAkcTh8zkgY0QEGhglJlzuYgJxmAWamCW6 t31khljGKzGj/SkLhC0tsX35VrBBnAI2Ep+a+6BqRCVurn7LDmFLSKxeCHIPiC0nMe3rGria 98fmM0LYIhKt985CxQUlHvzcDRWvlOj4vBjqSSmJu98OgD0pIbCNUWLS5JVMEInljBL37kAV mUu8fXkQLM4r4Cux9lEb2CAWAVWJ9onroepdJN6tuQkWZxaQl9j+dg4zyPfMApoS63fpw/zY sPE3OybbVuLc/j3MEK18Er2/nzBNYFSdhQjqWUiGzkIYuoCReRWjZGpBcW56arFpgXFearle cWJucWleul5yfu4mRnCi0vLewbjpnM8hRgEORiUe3gPqvyKFWBPLiitzDzFKcDArifC+l/od KcSbklhZlVqUH19UmpNafIhRmoNFSZz32M7SSCGB9MSS1OzU1ILUIpgsEwenFDAuK4z/rKpw 3WB+KnJHwL9qkcpN4U8cGWQMHhytWq505UVYglzCP9Pp8W4fmd79YFOM/28dqJ+iEtxkcSXz wqJ1ocVvpzC7yPNozNERzXMU/qTOwXq26+P13M5VFV8Uqg/b7Tov4HpTKfZs5FrZz10vOk21 bz88diaJy+5O1GZfkV95buv7apRYijMSDbWYi4oTAYC8nxpQAwAA X-CMS-RootMailID: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 X-RootMTR: 20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0 References: <20171019010841.GA17308@bombadil.infradead.org> <20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 19, 2017 at 6:38 AM, Matthew Wilcox wrote: > On Thu, Oct 19, 2017 at 12:31:18AM +0300, Timofey Titovets 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; >> > + } >> > +} >> >> Same here, but with memcpy(). > >No. Use memset_l which is optimised for this specific job. I have tested this patch using memset_l() function in zswap_fill_page() on x86 64-bit system with 2GB RAM. The performance remains same. But, memset_l() funcion might be optimised in future. @Seth Jennings/Dan Streetman: Should I use memset_l() function in this patch. From 1581697938815558360@xxx Thu Oct 19 14:51:40 +0000 2017 X-GM-THRID: 1581603008024215631 X-Gmail-Labels: Inbox,Category Forums