lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 17 Nov 2017 17:10:33 -0500
From:   Dan Streetman <ddstreet@...e.org>
To:     srividya.dr@...sung.com
Cc:     "sjenning@...hat.com" <sjenning@...hat.com>,
        Matthew Wilcox <willy@...radead.org>,
        Timofey Titovets <nefelim4ag@...il.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "penberg@...nel.org" <penberg@...nel.org>,
        Dinakar Reddy Pathireddy <dinakar.p@...sung.com>,
        SHARAN ALLUR <sharan.allur@...sung.com>,
        RAJIB BASU <rajib.basu@...sung.com>,
        JUHUN KIM <juhunkim@...sung.com>,
        "srividya.desireddy@...il.com" <srividya.desireddy@...il.com>
Subject: Re: [PATCH] zswap: Same-filled pages handling

On Thu, Nov 2, 2017 at 11:08 AM, Srividya Desireddy
<srividya.dr@...sung.com> wrote:
>
> 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.

my testing showed also showed minimal if any difference when using
memset_l(), but it's simpler code and should never be slower than
looping.  I'll ack it if you want to send an additional patch making
this change (on top of the one I already acked).

>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ