Hi All, After another day of hard work I feel I have this CART implementation complete. It survives a pounding and the stats seem pretty stable. The things that need more work: 1) the hash function seems pretty lousy 2) __cart_remember() called from shrink_list() needs zone->lru_lock The whole non-resident code is based on the idea that the hash function gives an even spread so that: B1_j B1 ------ ~ ---- B2_j B2 However after a pounding the variance in (B1_j - B2_j) as given by the std. deviation: sqrt( - ^2) is around 10. And this for a bucket with 57 slots. The other issue is that __cart_remember() needs the zone->lru_lock. This function is called from shrink_list() where the lock is explicitly avoided, so this seems like an issue. Alternatives would be atomic_t for zone->nr_q or a per cpu counter delta. Suggestions? Also I made quite some changes in swap.c and vmscan.c without being an expert on the code. Did I foul up too bad? Then ofcourse I need to benchmark, suggestions? Any comments appreciated. Kind regards, Peter Zijlstra fs/exec.c | 2 fs/proc/proc_misc.c | 30 +++ include/linux/mm_inline.h | 22 ++ include/linux/mmzone.h | 10 - include/linux/page-flags.h | 8 + include/linux/swap.h | 33 ++++ init/main.c | 3 mm/Makefile | 3 mm/cart.c | 329 ++++++++++++++++++++++++++++++++++++++++++ mm/filemap.c | 10 - mm/memory.c | 8 - mm/nonresident.c | 348 +++++++++++++++++++++++++++++++++++++++++++++ mm/shmem.c | 7 mm/swap.c | 84 +--------- mm/swap_state.c | 2 mm/swapfile.c | 4 mm/vmscan.c | 228 ++--------------------------- 17 files changed, 819 insertions(+), 312 deletions(-) -- Peter Zijlstra