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


Groups > linux.kernel > #1224721

Re: [PATCH 1/3] zram: make max_zpage_size configurable

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] zram: make max_zpage_size configurable
Date 2015-09-15 09:40 +0200
Message-ID <q8T0n-6AI-31@gated-at.bofh.it> (permalink)
References <q8CiT-7Pp-31@gated-at.bofh.it> <q8Csy-80G-7@gated-at.bofh.it> <q8MUW-6nq-15@gated-at.bofh.it> <q8T0n-6AI-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (09/15/15 09:18), Vitaly Wool wrote:
>    > On (09/14/15 15:50), Vitaly Wool wrote:
>    > > It makes sense to have control over what compression ratios are
>    > > ok to store pages uncompressed and what not.
>    >
>    > um... I don't want this to be exported. this is very 'zram-internal'.
>    >
>    > besides, you remove the exsiting default value
>    > - static const size_t max_zpage_size = PAGE_SIZE / 4 * 3;
>    >
>    > so now people must provide this module param in order to make zram
>    > work the way it used to work for years?
>    >
> 
>    I do not remove it, I move it :) May I ask to review the patch again
>    please?

Oh, yep, missed that.

Please read Dan Streetman's reply. I agree with what he said/suggested.


And can you please switch your email client to 'plain text' mode only?
haven't checked, but I suspect that some of vger lists block !plain_text
emails. ... apart from the fact that it's hard to read such emails in
mutt, etc.

	-ss

>    >
>    > > Moreover, if we end up using zbud allocator for zram, any attempt to
>    > > allocate a whole page will fail, so we may want to avoid this as much
>    > > as possible.
>    >
>    > so how does it help?
>    >
>    > > So, let's have max_zpage_size configurable as a module parameter.
>    > >
>    > > Signed-off-by: Vitaly Wool <[2]vitalywool@gmail.com>
>    > > ---
>    > >  drivers/block/zram/zram_drv.c | 13 +++++++++++++
>    > >  drivers/block/zram/zram_drv.h | 16 ----------------
>    > >  2 files changed, 13 insertions(+), 16 deletions(-)
>    > >
>    > > diff --git a/drivers/block/zram/zram_drv.c
>    b/drivers/block/zram/zram_drv.c
>    > > index 9fa15bb..6d9f1d1 100644
>    > > --- a/drivers/block/zram/zram_drv.c
>    > > +++ b/drivers/block/zram/zram_drv.c
>    > > @@ -42,6 +42,7 @@ static const char *default_compressor = "lzo";
>    > >
>    > >  /* Module params (documentation at end) */
>    > >  static unsigned int num_devices = 1;
>    > > +static size_t max_zpage_size = PAGE_SIZE / 4 * 3;
>    > >
>    > >  static inline void deprecated_attr_warn(const char *name)
>    > >  {
>    > > @@ -1411,6 +1412,16 @@ static int __init zram_init(void)
>    > >               return ret;
>    > >       }
>    > >
>    > > +     /*
>    > > +      * max_zpage_size must be less than or equal to:
>    > > +      * ZS_MAX_ALLOC_SIZE. Otherwise, zs_malloc() would
>    > > +      * always return failure.
>    > > +      */
>    > > +     if (max_zpage_size > PAGE_SIZE) {
>    > > +             pr_err("Invalid max_zpage_size %ld\n", max_zpage_size);
>    >
>    > and how do people find out ZS_MAX_ALLOC_SIZE? this error message does
>    not
>    > help.
>    >
>    > > +             return -EINVAL;
>    > > +     }
>    > > +
>    > >       zram_major = register_blkdev(0, "zram");
>    > >       if (zram_major <= 0) {
>    > >               pr_err("Unable to get major number\n");
>    > > @@ -1444,6 +1455,8 @@ module_exit(zram_exit);
>    > >
>    > >  module_param(num_devices, uint, 0);
>    > >  MODULE_PARM_DESC(num_devices, "Number of pre-created zram devices");
>    > > +module_param(max_zpage_size, ulong, 0);
>    > > +MODULE_PARM_DESC(max_zpage_size, "Threshold for storing compressed
>    pages");
>    >
>    > unclear description.
>    >
>    >
>    > >
>    > >  MODULE_LICENSE("Dual BSD/GPL");
>    > >  MODULE_AUTHOR("Nitin Gupta <[3]ngupta@vflare.org>");
>    > > diff --git a/drivers/block/zram/zram_drv.h
>    b/drivers/block/zram/zram_drv.h
>    > > index 8e92339..3a29c33 100644
>    > > --- a/drivers/block/zram/zram_drv.h
>    > > +++ b/drivers/block/zram/zram_drv.h
>    > > @@ -20,22 +20,6 @@
>    > >
>    > >  #include "zcomp.h"
>    > >
>    > > -/*-- Configurable parameters */
>    > > -
>    > > -/*
>    > > - * Pages that compress to size greater than this are stored
>    > > - * uncompressed in memory.
>    > > - */
>    > > -static const size_t max_zpage_size = PAGE_SIZE / 4 * 3;
>    > > -
>    > > -/*
>    > > - * NOTE: max_zpage_size must be less than or equal to:
>    > > - *   ZS_MAX_ALLOC_SIZE. Otherwise, zs_malloc() would
>    > > - * always return failure.
>    > > - */
>    > > -
>    > > -/*-- End of configurable params */
>    > > -
>    > >  #define SECTOR_SHIFT         9
>    > >  #define SECTORS_PER_PAGE_SHIFT       (PAGE_SHIFT - SECTOR_SHIFT)
>    > >  #define SECTORS_PER_PAGE     (1 << SECTORS_PER_PAGE_SHIFT)
>    > > --
>    > > 1.9.1
>    > >
>    > > --
>    > > To unsubscribe, send a message with 'unsubscribe linux-mm' in
>    > > the body to [4]majordomo@kvack.org.  For more info on Linux MM,
>    > > see: [5]http://www.linux-mm.org/ .
>    > > Don't email: <a href=mailto:"[6]dont@kvack.org"> [7]email@kvack.org
>    </a>
>    > >
> 
> References
> 
>    Visible links
>    1. mailto:sergey.senozhatsky.work@gmail.com
>    2. mailto:vitalywool@gmail.com
>    3. mailto:ngupta@vflare.org
>    4. mailto:majordomo@kvack.org
>    5. http://www.linux-mm.org/
>    6. mailto:dont@kvack.org
>    7. mailto:email@kvack.org
--
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