[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D33AB581-608A-43DD-B47F-AA93DC9CA432@FreeBSD.org>
Date: Fri, 12 Apr 2013 23:20:27 -0700
From: Suleiman Souhlal <ssouhlal@...eBSD.org>
To: Seth Jennings <sjenning@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Nitin Gupta <ngupta@...are.org>,
Minchan Kim <minchan@...nel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Dan Magenheimer <dan.magenheimer@...cle.com>,
Robert Jennings <rcj@...ux.vnet.ibm.com>,
Jenifer Hopper <jhopper@...ibm.com>,
Mel Gorman <mgorman@...e.de>,
Johannes Weiner <jweiner@...hat.com>,
Rik van Riel <riel@...hat.com>,
Larry Woodman <lwoodman@...hat.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Joe Perches <joe@...ches.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Cody P Schafer <cody@...ux.vnet.ibm.com>,
Hugh Dickens <hughd@...gle.com>,
Paul Mackerras <paulus@...ba.org>,
Heesub Shin <heesub.shin@...sung.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org
Subject: Re: [PATCHv9 4/8] zswap: add to mm/
Hello,
On Apr 10, 2013, at 11:18 , Seth Jennings wrote:
> +/* invalidates all pages for the given swap type */
> +static void zswap_frontswap_invalidate_area(unsigned type)
> +{
> + struct zswap_tree *tree = zswap_trees[type];
> + struct rb_node *node;
> + struct zswap_entry *entry;
> +
> + if (!tree)
> + return;
> +
> + /* walk the tree and free everything */
> + spin_lock(&tree->lock);
> + /*
> + * TODO: Even though this code should not be executed because
> + * the try_to_unuse() in swapoff should have emptied the tree,
> + * it is very wasteful to rebalance the tree after every
> + * removal when we are freeing the whole tree.
> + *
> + * If post-order traversal code is ever added to the rbtree
> + * implementation, it should be used here.
> + */
> + while ((node = rb_first(&tree->rbroot))) {
> + entry = rb_entry(node, struct zswap_entry, rbnode);
> + rb_erase(&entry->rbnode, &tree->rbroot);
> + zs_free(tree->pool, entry->handle);
> + zswap_entry_cache_free(entry);
> + }
> + tree->rbroot = RB_ROOT;
> + spin_unlock(&tree->lock);
> +}
Should both the pool and the tree also be freed, here?
-- Suleiman
--
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