Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762676AbdDSLvc (ORCPT ); Wed, 19 Apr 2017 07:51:32 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:49352 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762277AbdDSLv3 (ORCPT ); Wed, 19 Apr 2017 07:51:29 -0400 Date: Wed, 19 Apr 2017 04:51:25 -0700 From: Matthew Wilcox To: Minchan Kim Cc: 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: <20170419115125.GA27790@bombadil.infradead.org> References: <20170417014803.GC518@jagdpanzerIV.localdomain> <20170418000319.GC21354@bbox> <20170418073307.GF22360@dhcp22.suse.cz> <20170419060237.GA1636@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170419060237.GA1636@bbox> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 728 Lines: 17 On Wed, Apr 19, 2017 at 03:02:37PM +0900, Minchan Kim wrote: > On Tue, Apr 18, 2017 at 09:33:07AM +0200, Michal Hocko wrote: > > I do not follow. Why would you need kmap for something that is already > > in the kernel space? > > Because it can work with highmem pages. That's copy_user_highpage(). If you want to define a new arch API copy_highpage(), feel free to make a case for it ... > > > 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?