Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was "zram: do not use copy_page with non-page alinged address")
From: Christoph Lameter
Date: Tue Apr 18 2017 - 09:28:26 EST
On Tue, 18 Apr 2017, Sergey Senozhatsky wrote:
> > Simple solution is to not allocate pages via the slab allocator but use
> > the page allocator for this. The page allocator provides proper alignment.
>
> sure, but at the same time it's not completely uncommon and unseen thing
>
> ~/_next$ git grep kmalloc | grep PAGE_SIZE | wc -l
> 75
Of course if you want a PAGE_SIZE object that is not really page aligned
etc then its definitely ok to use.
> not all, if any, of those pages get into copy_page(), of course. may be... hopefully.
> so may be a warning would make sense and save time some day. but up to MM
> people to decide.
Slab objects are copied using memcpy. copy_page is for pages aligned to
page boundaries and the arch code there may have additional expectations
that cannot be met by the slab allocators.
> p.s. Christoph, FYI, gmail automatically marked your message
> as a spam message, for some reason.
Weird. Any more details as to why?