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


Groups > linux.kernel > #1630222

Re: [PATCH v3 3/4] zram: make deduplication feature optional

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/4] zram: make deduplication feature optional
Date 2017-04-25 09:00 +0200
Message-ID <tA2C5-1bC-1@gated-at.bofh.it> (permalink)
References <tyvoS-7Sg-5@gated-at.bofh.it> <tyvoS-7Sg-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Apr 21, 2017 at 10:14:50AM +0900, js1304@gmail.com wrote:
> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> 
> Benefit of deduplication is dependent on the workload so it's not
> preferable to always enable. Therefore, make it optional in Kconfig
> and device param. Default is 'off'. This option will be beneficial
> for users who use the zram as blockdev and stores build output to it.
> 
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

< snip >

>  
>  static struct attribute *zram_disk_attrs[] = {
>  	&dev_attr_disksize.attr,
> @@ -1169,6 +1227,7 @@ static struct attribute *zram_disk_attrs[] = {
>  	&dev_attr_mem_used_max.attr,
>  	&dev_attr_max_comp_streams.attr,
>  	&dev_attr_comp_algorithm.attr,
> +	&dev_attr_use_dedup.attr,
>  	&dev_attr_io_stat.attr,
>  	&dev_attr_mm_stat.attr,
>  	&dev_attr_debug_stat.attr,
> diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
> index 4b86921..3f7649a 100644
> --- a/drivers/block/zram/zram_drv.h
> +++ b/drivers/block/zram/zram_drv.h
> @@ -134,7 +134,12 @@ struct zram {
>  	 * zram is claimed so open request will be failed
>  	 */
>  	bool claim; /* Protected by bdev->bd_mutex */
> +	bool use_dedup;
>  };
>  
> +static inline bool zram_dedup_enabled(struct zram *zram)
> +{
> +	return zram->use_dedup;

#ifdef CONFIG_ZRAM_DEDUP
        return zram->use_dedup;
#else
        return false;
#endif

Otherwise, looks good to me.

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


Thread

[PATCH v3 3/4] zram: make deduplication feature optional js1304@gmail.com - 2017-04-21 03:20 +0200
  Re: [PATCH v3 3/4] zram: make deduplication feature optional Minchan Kim <minchan@kernel.org> - 2017-04-25 09:00 +0200
    Re: [PATCH v3 3/4] zram: make deduplication feature optional Joonsoo Kim <js1304@gmail.com> - 2017-04-25 10:20 +0200
  Re: [PATCH v3 3/4] zram: make deduplication feature optional Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-04-25 12:30 +0200
    Re: [PATCH v3 3/4] zram: make deduplication feature optional Joonsoo Kim <js1304@gmail.com> - 2017-04-26 03:00 +0200

csiph-web