From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id 121D26B0038 for ; Wed, 18 Oct 2017 21:08:46 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id l24so5319893pgu.22 for ; Wed, 18 Oct 2017 18:08:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id o63si7028331pfg.336.2017.10.18.18.08.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 18:08:44 -0700 (PDT) Date: Wed, 18 Oct 2017 18:08:41 -0700 From: Matthew Wilcox 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: Sender: owner-linux-mm@kvack.org List-ID: 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" 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@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org