From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756547AbdDRK5X (ORCPT ); Tue, 18 Apr 2017 06:57:23 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35039 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755705AbdDRK4j (ORCPT ); Tue, 18 Apr 2017 06:56:39 -0400 Date: Tue, 18 Apr 2017 19:56:41 +0900 From: Sergey Senozhatsky To: Michal Hocko Cc: Minchan Kim , 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: <20170418105641.GC558@jagdpanzerIV.localdomain> References: <20170417014803.GC518@jagdpanzerIV.localdomain> <20170418000319.GC21354@bbox> <20170418073307.GF22360@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170418073307.GF22360@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 On (04/18/17 09:33), Michal Hocko 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. > > 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. -ss