From: Andrew Morton <akpm@linux-foundation.org>
To: Weijie Yang <weijie.yang@samsung.com>
Cc: sjenning@linux.vnet.ibm.com, sjennings@variantweb.net,
'Minchan Kim' <minchan@kernel.org>,
bob.liu@oracle.com, weijie.yang.kh@gmail.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/zswap: refoctor the get/put routines
Date: Mon, 14 Oct 2013 15:26:15 -0700 [thread overview]
Message-ID: <20131014152615.0c0e9c8467fd63fdd31f4add@linux-foundation.org> (raw)
In-Reply-To: <000101cec8c6$01b10020$05130060$%yang@samsung.com>
On Mon, 14 Oct 2013 18:12:34 +0800 Weijie Yang <weijie.yang@samsung.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@kernel.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2013-10-14 22:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 10:12 [PATCH 2/2] mm/zswap: refoctor the get/put routines Weijie Yang
2013-10-14 22:26 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131014152615.0c0e9c8467fd63fdd31f4add@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=bob.liu@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sjenning@linux.vnet.ibm.com \
--cc=sjennings@variantweb.net \
--cc=stable@vger.kernel.org \
--cc=weijie.yang.kh@gmail.com \
--cc=weijie.yang@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).