From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751376AbdJSBIp (ORCPT ); Wed, 18 Oct 2017 21:08:45 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:60195 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbdJSBIo (ORCPT ); Wed, 18 Oct 2017 21:08:44 -0400 Date: Wed, 18 Oct 2017 18:08:41 -0700 From: Matthew Wilcox To: Timofey Titovets Cc: Srividya Desireddy , "sjenning@redhat.com" , "ddstreet@ieee.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "penberg@kernel.org" , Dinakar Reddy Pathireddy , SHARAN ALLUR , RAJIB BASU , JUHUN KIM , "srividya.desireddy@gmail.com" Subject: Re: [PATCH] zswap: Same-filled pages handling Message-ID: <20171019010841.GA17308@bombadil.infradead.org> References: <20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.