Re: [PATCH 7/8] zswap: add to mm/

Dave Hansen
2013-01-02T18:18:05Z

On 01/02/2013 09:26 AM, Dan Magenheimer wrote:
> However if one compares the total percentage
> of RAM used for zpages by zswap vs the total percentage of RAM
> used by slab, I suspect that the zswap number will dominate,
> perhaps because zswap is storing primarily data and slab is
> storing primarily metadata?

That's *obviously* 100% dependent on how you configure zswap. But, that
said, most of _my_ systems tend to sit with about 5% of memory in
reclaimable slab which is certainly on par with how I'd expect to see
zswap used.

> I don't claim to be any kind of expert here, but I'd imagine
> that MM doesn't try to manage the total amount of slab space
> because slab is "a cost of doing business". However, for
> in-kernel compression to be widely useful, IMHO it will be
> critical for MM to somehow load balance between total pageframes
> used for compressed pages vs total pageframes used for
> normal pages, just as today it needs to balance between
> active and inactive pages.

The issue isn't about balancing. It's about reclaim where the VM only
cares about whole pages. If our subsystem (zwhatever or slab) is only
designed to reclaim _parts_ of pages, can we be successful in returning
whole pages to the VM?

The slab shrinkers only work on parts of pages (singular slab objects).
Yet, it does appear that they function well enough when we try to
reclaim from them. I've never seen a slab's sizes spiral out of control
due to fragmentation.