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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200123022305.GF249784@google.com>
Date:   Wed, 22 Jan 2020 18:23:05 -0800
From:   Minchan Kim <minchan@...nel.org>
To:     Yue Hu <zbestahu@...il.com>
Cc:     ngupta@...are.org, sergey.senozhatsky.work@...il.com,
        linux-kernel@...r.kernel.org, huyue2@...ong.com
Subject: Re: [PATCH] zram: do not set ZRAM_IDLE bit for idlepage writeback in
 writeback_store()

On Tue, Jan 21, 2020 at 07:35:57PM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@...ong.com>
> 
> Currently, we will call zram_set_flag() to set ZRAM_IDLE bit even for
> idlepage writeback. That is pointless. Let's set it only for hugepage mode.

Could you be more specific? What do you see the problem with that?

> 
> Signed-off-by: Yue Hu <huyue2@...ong.com>
> ---
>  drivers/block/zram/zram_drv.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 4285e75..eef5767 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -689,16 +689,18 @@ static ssize_t writeback_store(struct device *dev,
>  		if (mode == IDLE_WRITEBACK &&
>  			  !zram_test_flag(zram, index, ZRAM_IDLE))
>  			goto next;
> -		if (mode == HUGE_WRITEBACK &&
> -			  !zram_test_flag(zram, index, ZRAM_HUGE))
> -			goto next;
> +		if (mode == HUGE_WRITEBACK) {
> +			if (!zram_test_flag(zram, index, ZRAM_HUGE))
> +				goto next;
> +			/* Need for hugepage writeback racing */
> +			zram_set_flag(zram, index, ZRAM_IDLE);
> +		}
> +
>  		/*
>  		 * Clearing ZRAM_UNDER_WB is duty of caller.
>  		 * IOW, zram_free_page never clear it.
>  		 */
>  		zram_set_flag(zram, index, ZRAM_UNDER_WB);
> -		/* Need for hugepage writeback racing */
> -		zram_set_flag(zram, index, ZRAM_IDLE);
>  		zram_slot_unlock(zram, index);
>  		if (zram_bvec_read(zram, &bvec, index, 0, NULL)) {
>  			zram_slot_lock(zram, index);
> -- 
> 1.9.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ