lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141022072706.GE21620@bbox>
Date:	Wed, 22 Oct 2014 16:27:06 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	karam.lee@....com
Cc:	ngupta@...are.org, linux-kernel@...r.kernel.org,
	matthew.r.wilcox@...el.com, jmarchan@...hat.com,
	seungho1.park@....com
Subject: Re: [PATCH v4 3/3] zram: implement rw_page operation of zram

Hi karam,

On Wed, Oct 22, 2014 at 04:04:14PM +0900, karam.lee@....com wrote:
> From: "karam.lee" <karam.lee@....com>
> 
> This patch implements rw_page operation for zram block device.
> 
> I implemented the feature in zram and tested it.
> Test bed was the G2, LG electronic mobile device, whtich has msm8974
> processor and 2GB memory.
> With a memory allocation test program consuming memory, the system
> generates swap.
> And operating time of swap_write_page() was measured.
> 
> --------------------------------------------------
> |             |   operating time   | improvement |
> |             |  (20 runs average) |             |
> --------------------------------------------------
> |with patch   |    1061.15 us      |    +2.4%    |
> --------------------------------------------------
> |without patch|    1087.35 us      |             |
> --------------------------------------------------
> 
> Each test(with paged_io,with BIO) result set shows normal distribution
> and has equal variance.
> I mean the two values are valid result to compare.
> I can say operation with paged I/O(without BIO) is faster 2.4% with
> confidence level 95%.
> 
> Signed-off-by: karam.lee <karam.lee@....com>
> ---
>  drivers/block/zram/zram_drv.c |   38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 4565fdc..8bbd4f2 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -810,8 +810,46 @@ static void zram_slot_free_notify(struct block_device *bdev,
>  	atomic64_inc(&zram->stats.notify_free);
>  }
>  
> +static int zram_rw_page(struct block_device *bdev, sector_t sector,
> +		       struct page *page, int rw)
> +{
> +	int offset, ret;
> +	u32 index;
> +	struct zram *zram;
> +	struct bio_vec bv;
> +
> +	zram = bdev->bd_disk->private_data;
> +	if (!valid_io_request(zram, sector, PAGE_SIZE)) {
> +		atomic64_inc(&zram->stats.invalid_io);
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	down_read(&zram->init_lock);
> +	if (unlikely(!init_done(zram))) {
> +		ret = -ENOMEM;

Why is it -ENOMEM?
I think EIO is better like bio_io_error.

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ