From: Dan Streetman <ddstreet@ieee.org>
To: Seth Jennings <sjennings@variantweb.net>
Cc: Dan Streetman <ddstreet@ieee.org>,
linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>,
Bob Liu <bob.liu@oracle.com>, Minchan Kim <minchan@kernel.org>,
Weijie Yang <weijie.yang@samsung.com>
Subject: [PATCH] mm/zswap: remove unneeded zswap_rb_erase calls
Date: Wed, 20 Nov 2013 14:47:04 -0500 [thread overview]
Message-ID: <1384976824-32624-1-git-send-email-ddstreet@ieee.org> (raw)
Since zswap_rb_erase was added to the final (when refcount == 0)
zswap_put_entry, there is no need to call zswap_rb_erase before
calling zswap_put_entry.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
---
mm/zswap.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index e154f1e..f4fbbd5 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -711,8 +711,6 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset,
ret = zswap_rb_insert(&tree->rbroot, entry, &dupentry);
if (ret == -EEXIST) {
zswap_duplicate_entry++;
- /* remove from rbtree */
- zswap_rb_erase(&tree->rbroot, dupentry);
zswap_entry_put(tree, dupentry);
}
} while (ret == -EEXIST);
@@ -787,9 +785,6 @@ static void zswap_frontswap_invalidate_page(unsigned type, pgoff_t offset)
return;
}
- /* remove from rbtree */
- zswap_rb_erase(&tree->rbroot, entry);
-
/* drop the initial reference from entry creation */
zswap_entry_put(tree, entry);
--
1.8.3.1
next reply other threads:[~2013-11-20 19:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 19:47 Dan Streetman [this message]
2013-11-21 2:52 ` [PATCH] mm/zswap: remove unneeded zswap_rb_erase calls Weijie Yang
2013-11-21 22:33 ` Dan Streetman
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=1384976824-32624-1-git-send-email-ddstreet@ieee.org \
--to=ddstreet@ieee.org \
--cc=bob.liu@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sjennings@variantweb.net \
--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).