lkml.org 
[lkml]   [2017]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zswap: Same-filled pages handling
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));
}

(and you should see significantly better numbers at least on x86;
I don't know if anyone's done an arm64 version of memset_l yet).

\
 
 \ /
  Last update: 2017-10-22 17:13    [W:0.138 / U:5.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site