D Dan Magenheimer #
Message details and related content
Here finally is the long promised rewrite of zcache (and ramster). I know that we are concentrating on moving zcache from staging, and not ramster. However the amount of duplicate code that ramster used from zcache is astonishing so when I did the rewrite I thought why not kill two birds with one stone - since both are in the staging directory. Of notable interest to the broader mm community, I am proposing, when review is complete, to place zcache in a new subdirectory of mm, called "tmem" (short for transcendent memory). Zcache is truly memory management, not a hardware driver, and it interfaces with mm/swap/vfs through mm/cleancache.c and mm/frontswap.c (which possibly should move to the new tmem directory in the future as well). This is a major rewrite for zcache, not a sequence of small patches. So those who are interested in understanding, reviewing, and commenting in detail on the design and the functioning of the code can find it at: git://oss.oracle.com/git/djm/tmem.git #zcache-120731 For those who prefer to review and comment line-by-line, it's not clear yet how best to post the ~10K lines of code to ensure reviewer productivity. Konrad suggested an IRC talk on Monday to talk about this so we can figure out what is the proper option. (If you are not familiar with the tmem terminology, you can review it here: http://lwn.net/Articles/454795/ ) Some of the highlights of this git branch: 1. Merge of zcache and ramster. Zcache and ramster had a great deal of duplicate code which is now merged. In essence, zcache *is* ramster but with no remote machine available, but !CONFIG_RAMSTER will avoid compiling lots of ramster-specific code. 2. Allocator. Previously, persistent pools used zsmalloc and ephemeral pools used zbud. Now a completely rewritten zbud is used for both. Notably this zbud maintains all persistent (frontswap) and ephemeral (cleancache) pageframes in separate queues in LRU order. 3. Interaction with page allocator. Zbud does no page allocation/freeing, it is done entirely in zcache where it can be tracked more effectively.