Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1337029
| From | Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE |
| Date | 2016-02-18 06:10 +0100 |
| Message-ID | <r3p0J-Bk-7@gated-at.bofh.it> (permalink) |
| References | <r3n8B-7Ib-3@gated-at.bofh.it> <r3n8C-7Ib-15@gated-at.bofh.it> <r3oHn-fk-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On (02/18/16 13:41), Sergey Senozhatsky wrote:
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index 0c9f117..d5252d1 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -73,12 +73,6 @@
> */
> #define ZS_ALIGN 8
>
> -/*
> - * A single 'zspage' is composed of up ZS_MAX_PAGES_PER_ZSPAGE discontiguous
> - * 0-order (single) pages.
> - */
> -#define ZS_MAX_PAGES_PER_ZSPAGE 6
> -
> #define ZS_HANDLE_SIZE (sizeof(unsigned long))
>
> /*
> @@ -149,6 +143,21 @@
> #define ZS_SIZE_CLASS_DELTA (PAGE_SIZE >> 8)
>
> /*
> + * We want to have at least this number of ->huge classes.
> + */
> +#define ZS_MIN_HUGE_CLASSES_NUM 32
> +/*
> + * A single 'zspage' is composed of up ZS_MAX_PAGES_PER_ZSPAGE discontiguous
> + * 0-order (single) pages.
> + *
> + * The smallest huge class will have CLASS_SIZE * SIZE_CLASS_DELTA of
> + * wasted space, calculate how many pages we need to fit a CLASS_SIZE
> + * object there and, thus, to save a additional zspage.
> + */
> +#define ZS_MAX_PAGES_PER_ZSPAGE \
> + (PAGE_SIZE / (ZS_MIN_HUGE_CLASSES_NUM * ZS_SIZE_CLASS_DELTA))
> +
> +/*
> * We do not maintain any list for completely empty or full pages
> */
> enum fullness_group {
and the difference between ZS_MIN_HUGE_CLASSES_NUM 57 (BASE number of
->huge classes) and ZS_MIN_HUGE_CLASSES_NUM 32 is:
ZS_MIN_HUGE_CLASSES_NUM 57 (BASE)
1151078400 575501415 621494272 0 621494272 17 0 1
1151074304 575499905 621477888 0 621477888 17 0 1
1151074304 575516318 621363200 0 621363200 17 0 1
1151078400 575558182 621346816 0 621346816 17 0 1
1151078400 575599320 621531136 0 621531136 17 0 1
ZS_MIN_HUGE_CLASSES_NUM 32
1151074304 575483112 594194432 0 594194432 17 0 1
1151074304 575521895 593678336 0 593678336 17 0 1
1151074304 575570453 594173952 0 594173952 17 0 1
1151074304 575461842 594010112 0 594010112 17 0 1
1151074304 575537116 593879040 0 593879040 17 0 1
around 26MB of order-0 pages.
-ss
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/3] mm/zsmalloc: increase density and reduce memory wastage Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 04:10 +0100
[RFC PATCH 2/3] zram: use zs_get_huge_class_size_watermark() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 04:10 +0100
[RFC PATCH 1/3] mm/zsmalloc: introduce zs_get_huge_class_size_watermark() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 04:10 +0100
[RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 04:10 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 05:50 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 05:50 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 06:10 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Joonsoo Kim <js1304@gmail.com> - 2016-02-18 09:30 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 11:00 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-18 11:20 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Joonsoo Kim <js1304@gmail.com> - 2016-02-19 02:30 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-19 05:20 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-19 05:20 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-19 05:50 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-19 06:40 +0100
Re: [RFC PATCH 3/3] mm/zsmalloc: change ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-19 07:00 +0100
csiph-web