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] [day] [month] [year] [list]
Date:	Mon, 14 Oct 2013 15:26:15 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Weijie Yang <weijie.yang@...sung.com>
Cc:	sjenning@...ux.vnet.ibm.com, sjennings@...iantweb.net,
	"'Minchan Kim'" <minchan@...nel.org>, bob.liu@...cle.com,
	weijie.yang.kh@...il.com, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, stable@...r.kernel.org
Subject: Re: [PATCH 2/2] mm/zswap: refoctor the get/put routines

On Mon, 14 Oct 2013 18:12:34 +0800 Weijie Yang <weijie.yang@...sung.com> wrote:

> The refcount routine was not fit the kernel get/put semantic exactly,
> There were too many judgement statements on refcount and it could be minus.
> 
> This patch does the following:
> 
> - move refcount judgement to zswap_entry_put() to hide resource free function.
> 
> - add a new function zswap_entry_find_get(), so that callers can use easily
> in the following pattern:
> 
>    zswap_entry_find_get
>    .../* do something */
>    zswap_entry_put
> 
> - to eliminate compile error, move some functions declaration
> 
> This patch is based on Minchan Kim <minchan@...nel.org> 's idea and suggestion.
> 
> ...
>
> @@ -815,7 +809,7 @@ static void zswap_frontswap_invalidate_area(unsigned type)
>  	 */
>  	while ((node = rb_first(&tree->rbroot))) {
>  		entry = rb_entry(node, struct zswap_entry, rbnode);
> -		rb_erase(&entry->rbnode, &tree->rbroot);
> +		zswap_rb_erase(&tree->rbroot, entry);
>  		zbud_free(tree->pool, entry->handle);
>  		zswap_entry_cache_free(entry);
>  		atomic_dec(&zswap_stored_pages);
> -- 

zswap_frontswap_invalidate_area() has changed significantly in curent
mainline, so this will need redoing please.

--
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