OpenVZ Forum


Home » Mailing lists » Devel » [RFC] memory controller : backgorund reclaim and avoid excessive locking [0/5]
Re: [RFC] memory controller : backgorund reclaim and avoid excessive locking [5/5] lazy page_cgroup [message #27421 is a reply to message #27304] Mon, 18 February 2008 01:58 Go to previous messageGo to previous message
yamamoto is currently offline  yamamoto
Messages: 97
Registered: July 2007
Member
> +	/*
> +	 * For lazy freeing (not GC)
> +	 */
> +	struct {
> +		struct mem_cgroup_per_zone *mz;
> +		int			num;
> +#define GARBAGE_MAXSIZE		(16)
> +		struct page_cgroup	*vec[GARBAGE_MAXSIZE];
> +	} garbage[NR_CPUS];
>  };

i think you want to dedicate cache lines.

> @@ -176,12 +185,14 @@ struct page_cgroup {
>  	struct list_head lru;		/* per cgroup LRU list */
>  	struct page *page;
>  	struct mem_cgroup *mem_cgroup;
> +	struct mem_cgroup_per_zone *mz;	/* now belongs to...*/

is this for performance?

> @@ -408,10 +427,12 @@ static void __mem_cgroup_move_lists(stru
>  	if (active) {
>  		MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_ACTIVE) += 1;
>  		pc->flags |= PAGE_CGROUP_FLAG_ACTIVE;
> +		pc->mz = mz;
>  		list_move(&pc->lru, &mz->active_list);
>  	} else {
>  		MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE) += 1;
>  		pc->flags &= ~PAGE_CGROUP_FLAG_ACTIVE;
> +		pc->mz = mz;
>  		list_move(&pc->lru, &mz->inactive_list);
>  	}
>  }

isn't pc->mz already assigned by __mem_cgroup_add_list?

> @@ -1050,11 +1114,15 @@ mem_cgroup_force_empty_list(struct mem_c
>  	if (list_empty(list))
>  		return;
>  retry:
> +	all_free_garbages(mem);
>  	count = FORCE_UNCHARGE_BATCH;
>  	spin_lock_irqsave(&mz->lru_lock, flags);
>  
>  	while (--count && !list_empty(list)) {
>  		pc = list_entry(list->prev, struct page_cgroup, lru);
> +		/* If there are still garbage, exit and retry */
> +		if (pc->flags & PAGE_CGROUP_FLAG_GARBAGE)
> +			break;

i think mem_cgroup_isolate_pages needs a similar check.

YAMAMOTO Takashi
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC][PATCH 4/7] CGroup API: Add res_counter_read_uint()
Next Topic: [PATCH 1/7] cgroup: fix and update documentation
Goto Forum:
  


Current Time: Mon Jul 28 18:33:43 GMT 2025

Total time taken to generate the page: 0.29079 seconds