RE: [PATCHv6 0/8] zswap: compressed swap caching

Dan Magenheimer
2013-02-21T15:50:24Z

> From: Seth Jennings [mailto:sjenning@linux.vnet.ibm.com]
> Subject: [PATCHv6 0/8] zswap: compressed swap caching
>
> Changelog:
>
> v6:
> * fix improper freeing of rbtree (Cody)

Cody's bug fix reminded me of a rather fundamental question:

Why does zswap use a rbtree instead of a radix tree?

Intuitively, I'd expect that pgoff_t values would
have a relatively high level of locality AND at any one time
the set of stored pgoff_t values would be relatively non-sparse.
This would argue that a radix tree would result in fewer nodes
touched on average for lookup/insert/remove.

Do you have evidence that rbtree is better here?
(Preferably over a set of workloads larger than
kernbench and SPECjbb ;-) Or are there other
important design issues that disqualify a radix tree?

In the end, I guess either one (rbtree or radix tree)
will work, but it would be nice to get this kind of
fundamental design issue properly solved before merging
is to be considered.

Dan