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 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.

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