Re: [PATCH] zswap: Same-filled pages handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux