Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938432AbdDTBpn (ORCPT ); Wed, 19 Apr 2017 21:45:43 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:33027 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765018AbdDTBpk (ORCPT ); Wed, 19 Apr 2017 21:45:40 -0400 Date: Thu, 20 Apr 2017 10:45:42 +0900 From: Sergey Senozhatsky To: Matthew Wilcox Cc: Minchan Kim , Michal Hocko , Christoph Lameter , Sergey Senozhatsky , Joonsoo Kim , Andrew Morton , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Sergey Senozhatsky Subject: Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was "zram: do not use copy_page with non-page alinged address") Message-ID: <20170420014542.GA542@jagdpanzerIV.localdomain> References: <20170417014803.GC518@jagdpanzerIV.localdomain> <20170418000319.GC21354@bbox> <20170418073307.GF22360@dhcp22.suse.cz> <20170419060237.GA1636@bbox> <20170419115125.GA27790@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170419115125.GA27790@bombadil.infradead.org> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 634 Lines: 17 On (04/19/17 04:51), Matthew Wilcox wrote: [..] > > > > Another approach is the API does normal thing for non-aligned prefix and > > > > tail space and fast thing for aligned space. > > > > Otherwise, it would be happy if the API has WARN_ON non-page SIZE aligned > > > > address. > > Why not just use memcpy()? Is copy_page() significantly faster than > memcpy() for a PAGE_SIZE amount of data? that's a good point. I was going to ask yesterday - do we even need copy_page()? arch that provides well optimized copy_page() quite likely provides somewhat equally optimized memcpy(). so may be copy_page() is not even needed? -ss