From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933444AbdCKO45 (ORCPT ); Sat, 11 Mar 2017 09:56:57 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:59246 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbdCKO4r (ORCPT ); Sat, 11 Mar 2017 09:56:47 -0500 Date: Sat, 11 Mar 2017 06:56:40 -0800 From: Matthew Wilcox To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, sergey.senozhatsky@gmail.com, iamjoonsoo.kim@lge.com, ngupta@vflare.org, zhouxianrong@huawei.com, zhouxiyu@huawei.com, weidu.du@huawei.com, zhangshiming5@huawei.com, Mi.Sophia.Wang@huawei.com, won.ho.park@huawei.com Subject: memfill v2 now with ARM and x86 implementations Message-ID: <20170311145640.GB1860@bombadil.infradead.org> References: <1486307804-27903-1-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486307804-27903-1-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 06, 2017 at 12:16:44AM +0900, Minchan Kim wrote: > +static inline void zram_fill_page(char *ptr, unsigned long len, > + unsigned long value) > +{ > + int i; > + unsigned long *page = (unsigned long *)ptr; > + > + WARN_ON_ONCE(!IS_ALIGNED(len, sizeof(unsigned long))); > + > + if (likely(value == 0)) { > + memset(ptr, 0, len); > + } else { > + for (i = 0; i < len / sizeof(*page); i++) > + page[i] = value; > + } > +} I've hacked up memset32/memset64 for both ARM and x86 here: http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/heads/memfill Can you do some performance testing and see if it makes a difference? At this point, I'd probably ask for the first 5 patches in that git branch to be included, and leave out memfill and the shoddy testsuite. I haven't actually tested either asm implementation ... only the C fallback.