[Devel] [PATCH rh7 v2 05/10] tcache: Cache rb_first() of reclaim tree in tcache_nodeinfo::rb_first

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Aug 16 16:36:21 MSK 2017



On 08/16/2017 02:52 PM, Kirill Tkhai wrote:

>  
> @@ -242,6 +250,7 @@ static inline void __tcache_check_events(struct tcache_nodeinfo *ni,
>  
>  	rb_erase(&pni->reclaim_node, &ni->reclaim_tree);
>  	__tcache_insert_reclaim_node(ni, pni);
> +	update_ni_rb_first(ni);


Either add update_ni_rb_first() in tcache_lru_add() after __tcache_insert_reclaim_node() call
or add one update_ni_rb_first() in __tcache_insert_reclaim_node() itself and remove it from here
and ...

> @@ -1048,8 +1059,10 @@ tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
>  	nr_isolated = __tcache_lru_isolate(pni, pages, nr_to_isolate);
>  	ni->nr_pages -= nr_isolated;
>  
> -	if (!list_empty(&pni->lru))
> +	if (!list_empty(&pni->lru)) {
>  		__tcache_insert_reclaim_node(ni, pni);
> +		update_ni_rb_first(ni);

... from here.



More information about the Devel mailing list