[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171019010841.GA17308@bombadil.infradead.org>
Date: Wed, 18 Oct 2017 18:08:41 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Timofey Titovets <nefelim4ag@...il.com>
Cc: Srividya Desireddy <srividya.dr@...sung.com>,
"sjenning@...hat.com" <sjenning@...hat.com>,
"ddstreet@...e.org" <ddstreet@...e.org>,
"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, 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.
Powered by blists - more mailing lists