[Devel] [PATCH rh7 2/4] mm: workingset: update shadow limit to reflect bigger active list

Vasily Averin vvs at virtuozzo.com
Sat Dec 29 18:59:25 MSK 2018


minor note, I hope Kostja will handle this during commit.

On 12/29/18 6:48 PM, Andrey Ryabinin wrote:
> +	 * Nodes might be sparsely populated, with only one shadow
> +	 * entry in the extreme case. Obviously, we cannot keep one
> +	 * node for every eligible shadow entry, so compromise on a
> +	 * worst-case density of 1/8th. Below that, not all eligible
> +	 * refaults can be detected anymore.
> +         *

extra whitespaces here and on several lines below

> +         * On 64-bit with 7 radix_tree_nodes per page and 64 slots
> +         * each, this will reclaim shadow entries when they consume
> +	 * ~1.8% of available memory:
> +         *
> +	 * PAGE_SIZE / radix_tree_nodes / node_entries * 8 / PAGE_SIZE
> +         */
> +	cache = node_page_state(sc->nid, NR_ACTIVE_FILE) +
> +		node_page_state(sc->nid, NR_INACTIVE_FILE);
> +
> +	max_nodes =  cache >> (RADIX_TREE_MAP_SHIFT - 3);
>  
>  	if (shadow_nodes <= max_nodes)
>  		return 0;
> -- 


More information about the Devel mailing list