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


Groups > linux.kernel > #1226801

Re: [PATCH 0/3] allow zram to use zbud as underlying allocator

From Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/3] allow zram to use zbud as underlying allocator
Date 2015-09-17 11:30 +0200
Message-ID <q9DFW-7M8-37@gated-at.bofh.it> (permalink)
References (2 earlier) <q8CLU-b7-17@gated-at.bofh.it> <q8CLU-b7-15@gated-at.bofh.it> <q8PJ7-21k-1@gated-at.bofh.it> <q8Q2u-2pC-3@gated-at.bofh.it> <q9ARI-3xF-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (09/17/15 08:21), Vlastimil Babka wrote:
> On 09/15/2015 06:22 AM, Sergey Senozhatsky wrote:
> >On (09/15/15 00:08), Dan Streetman wrote:
> >[..]
> >
> >correct. a bit of internals: we don't scan all the zspages every
> >time. each class has stats for allocated used objects, allocated
> >used objects, etc. so we 'compact' only classes that can be
> >compacted:
> >
> >  static unsigned long zs_can_compact(struct size_class *class)
> >  {
> >          unsigned long obj_wasted;
> >
> >          obj_wasted = zs_stat_get(class, OBJ_ALLOCATED) -
> >                  zs_stat_get(class, OBJ_USED);
> >
> >          obj_wasted /= get_maxobj_per_zspage(class->size,
> >                          class->pages_per_zspage);
> >
> >          return obj_wasted * class->pages_per_zspage;
> >  }
> >
> >if we can free any zspages (which is at least one page), then we
> >attempt to do so.
> >
> >is compaction the root cause of the symptoms Vitaly observe?
> 
> He mentioned the "compact_stalls" counter which in /proc/vmstat is for the
> traditional physical memory compaction, not the zsmalloc-specific one. Which
> would imply high-order allocations. Does zsmalloc try them first before
> falling back to the order-0 zspages linked together manually?

each zspage is a bunch (pages_per_zspage) of alloc_page() calls

        for (i = 0; i < class->pages_per_zspage; i++) {
                struct page *page;

                page = alloc_page(flags);
                if (!page)
                        goto cleanup;

                INIT_LIST_HEAD(&page->lru);
                if (i == 0) {   /* first page */
                        SetPagePrivate(page);
                        set_page_private(page, 0);
                        first_page = page;
                        first_page->inuse = 0;
                }
                if (i == 1)
                        set_page_private(first_page, (unsigned long)page);
                if (i >= 1)
                        set_page_private(page, (unsigned long)first_page);
                if (i >= 2)
                        list_add(&page->lru, &prev_page->lru);
                if (i == class->pages_per_zspage - 1)   /* last page */
                        SetPagePrivate2(page);
                prev_page = page;
        }

	-ss
--
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/3] allow zram to use zbud as underlying allocator Vitaly Wool <vitalywool@gmail.com> - 2015-09-14 15:50 +0200
  [PATCH 1/3] zram: make max_zpage_size configurable Vitaly Wool <vitalywool@gmail.com> - 2015-09-14 16:00 +0200
    Re: [PATCH 1/3] zram: make max_zpage_size configurable Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 03:10 +0200
      Re: [PATCH 1/3] zram: make max_zpage_size configurable Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 09:40 +0200
    Re: [PATCH 1/3] zram: make max_zpage_size configurable Dan Streetman <ddstreet@ieee.org> - 2015-09-15 07:50 +0200
      Re: [PATCH 1/3] zram: make max_zpage_size configurable Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 08:10 +0200
  [PATCH 3/3] zram: use common zpool interface Vitaly Wool <vitalywool@gmail.com> - 2015-09-14 16:00 +0200
    Re: [PATCH 3/3] zram: use common zpool interface Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 03:20 +0200
      Re: [PATCH 3/3] zram: use common zpool interface Dan Streetman <ddstreet@ieee.org> - 2015-09-15 08:10 +0200
  [PATCH 2/3] zpool/zsmalloc/zbud: align on interfaces Vitaly Wool <vitalywool@gmail.com> - 2015-09-14 16:00 +0200
    Re: [PATCH 2/3] zpool/zsmalloc/zbud: align on interfaces Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 03:10 +0200
      Re: [PATCH 2/3] zpool/zsmalloc/zbud: align on interfaces Dan Streetman <ddstreet@ieee.org> - 2015-09-15 07:10 +0200
  Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Vlastimil Babka <vbabka@suse.cz> - 2015-09-14 16:10 +0200
    Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Vlastimil Babka <vbabka@suse.cz> - 2015-09-14 16:20 +0200
      Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Dan Streetman <ddstreet@ieee.org> - 2015-09-15 06:10 +0200
        Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 06:30 +0200
          Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Vlastimil Babka <vbabka@suse.cz> - 2015-09-17 08:30 +0200
            Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-17 11:30 +0200
    Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Vitaly Wool <vitalywool@gmail.com> - 2015-09-14 16:20 +0200
  Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-15 02:50 +0200
  Re: [PATCH 0/3] allow zram to use zbud as underlying allocator Minchan Kim <minchan@kernel.org> - 2015-09-15 08:20 +0200

csiph-web