Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625322

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 <cl@linux.com>
Newsgroups linux.kernel
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")
Date 2017-04-18 15:30 +0200
Message-ID <txBmF-6Fw-3@gated-at.bofh.it> (permalink)
References <tx3XH-2FQ-9@gated-at.bofh.it> <txgLg-2iD-21@gated-at.bofh.it> <txyRP-57S-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was "zram:  do not use copy_page with non-page alinged address") Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-17 03:50 +0200
  Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Christoph Lameter <cl@linux.com> - 2017-04-17 17:30 +0200
    Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Minchan Kim <minchan@kernel.org> - 2017-04-18 02:10 +0200
      Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Michal Hocko <mhocko@kernel.org> - 2017-04-18 09:40 +0200
        Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Michal Hocko <mhocko@kernel.org> - 2017-04-18 13:10 +0200
          Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-19 08:20 +0200
        Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-18 13:10 +0200
        Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Minchan Kim <minchan@kernel.org> - 2017-04-19 08:10 +0200
          Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Matthew Wilcox <willy@infradead.org> - 2017-04-19 14:00 +0200
            Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-20 03:50 +0200
              Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Minchan Kim <minchan@kernel.org> - 2017-04-20 09:00 +0200
    Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-18 12:50 +0200
      Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Christoph Lameter <cl@linux.com> - 2017-04-18 15:30 +0200
    Re: copy_page() on a kmalloc-ed page with DEBUG_SLAB enabled (was  "zram: do not use copy_page with non-page alinged address") Matthew Wilcox <willy@infradead.org> - 2017-04-18 15:20 +0200

csiph-web