Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760197AbdDSGLu (ORCPT ); Wed, 19 Apr 2017 02:11:50 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35077 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759892AbdDSGLq (ORCPT ); Wed, 19 Apr 2017 02:11:46 -0400 Date: Wed, 19 Apr 2017 15:11:49 +0900 From: Sergey Senozhatsky To: Michal Hocko Cc: Sergey Senozhatsky , Minchan Kim , Christoph Lameter , 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: <20170419061149.GD2881@jagdpanzerIV.localdomain> References: <20170417014803.GC518@jagdpanzerIV.localdomain> <20170418000319.GC21354@bbox> <20170418073307.GF22360@dhcp22.suse.cz> <20170418105641.GC558@jagdpanzerIV.localdomain> <20170418110632.GN22360@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170418110632.GN22360@dhcp22.suse.cz> User-Agent: Mutt/1.8.1 (2017-04-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 561 Lines: 19 On (04/18/17 13:06), Michal Hocko wrote: [..] > > > copy_page is a performance sensitive function and I believe that we do > > > those tricks exactly for this purpose. > > > > a wild thought, > > > > use > > #define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) > > > > when DEBUG_SLAB is set? so arch copy_page() (if provided by arch) > > won't be affected otherwise. > > SLAB is not guaranteed to provide page size aligned object AFAIR. oh, if there are no guarantees for page_sized allocations regardless the .config then agree, won't help. -ss