[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170418110632.GN22360@dhcp22.suse.cz>
Date: Tue, 18 Apr 2017 13:06:32 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: Minchan Kim <minchan@...nel.org>, Christoph Lameter <cl@...ux.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-team@....com,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
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")
On Tue 18-04-17 19:56:41, Sergey Senozhatsky wrote:
> 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.
Wouldn't this just paper over bugs? SLAB is not guaranteed to provide
page size aligned object AFAIR.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists