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


Groups > linux.kernel > #1229479

Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations

From Dan Streetman <ddstreet@ieee.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations
Date 2015-09-21 17:30 +0200
Message-ID <qbbcu-2a3-19@gated-at.bofh.it> (permalink)
References <q9jnQ-3nM-17@gated-at.bofh.it> <q9jxw-3z3-5@gated-at.bofh.it> <q9H6P-4rU-33@gated-at.bofh.it> <q9YU2-5cX-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Sep 18, 2015 at 4:03 AM, Vitaly Wool <vitalywool@gmail.com> wrote:
>> I don't know how zsmalloc handles uncompressible PAGE_SIZE allocations, but
>> I wouldn't expect it to be any more clever than this? So why duplicate the
>> functionality in zswap and zbud? This could be handled e.g. at the zpool
>> level? Or maybe just in zram, as IIRC in zswap (frontswap) it's valid just
>> to reject a page and it goes to physical swap.

zpool doesn't actually store pages anywhere; zbud and zsmalloc do the
storing, and they do it in completely different ways.  Storing an
uncompressed page has to be done in zbud and zsmalloc, not zpool.  And
zram can't do it either; zram doesn't actually store pages either, it
relies on zsmalloc to store all its pages.

>
> From what I can see, zsmalloc just allocates pages and puts them into
> a linked list. Using the beginning of a page for storing an internal
> struct is zbud-specific, and so is this patch.

zsmalloc has size "classes" that allow storing "objects" of a specific
size range (i.e. the last class size + 1, up to class size).  the max
size class is:
#define ZS_MAX_ALLOC_SIZE PAGE_SIZE

so zsmalloc is able to store "objects" up to, and including, PAGE_SIZE.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH 0/2] prepare zbud to be used by zram as underlying allocator Vitaly Wool <vitalywool@gmail.com> - 2015-09-16 13:50 +0200
  [PATCH 1/2] zbud: allow PAGE_SIZE allocations Vitaly Wool <vitalywool@gmail.com> - 2015-09-16 14:00 +0200
    Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations Vlastimil Babka <vbabka@suse.cz> - 2015-09-17 15:10 +0200
      Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations Vitaly Wool <vitalywool@gmail.com> - 2015-09-18 10:10 +0200
        Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations Dan Streetman <ddstreet@ieee.org> - 2015-09-21 17:30 +0200
    Re: [PATCH 1/2] zbud: allow PAGE_SIZE allocations Dan Streetman <ddstreet@ieee.org> - 2015-09-21 18:20 +0200
  [PATCH 2/2] zpool/zsmalloc/zbud: align on interfaces Vitaly Wool <vitalywool@gmail.com> - 2015-09-16 14:00 +0200
    Re: [PATCH 2/2] zpool/zsmalloc/zbud: align on interfaces Dan Streetman <ddstreet@ieee.org> - 2015-09-21 19:20 +0200
  Re: [PATCH 0/2] prepare zbud to be used by zram as underlying  allocator Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-17 03:30 +0200
    Re: [PATCH 0/2] prepare zbud to be used by zram as underlying allocator Vitaly Wool <vitalywool@gmail.com> - 2015-09-17 12:30 +0200
      Re: [PATCH 0/2] prepare zbud to be used by zram as underlying  allocator Minchan Kim <minchan@kernel.org> - 2015-09-21 06:20 +0200
        Re: [PATCH 0/2] prepare zbud to be used by zram as underlying allocator Vitaly Wool <vitalywool@gmail.com> - 2015-09-21 23:20 +0200

csiph-web