Patch for Proportional RSS

Aggelos Economopoulos aoiko at cc.ece.ntua.gr
Mon Sep 27 15:35:56 PDT 2010


On 09/27/2010 11:16 PM, Pratyush Kshirsagar wrote:
> Hi!
> Here is the patch for the proportional RSS. I have attached the diff also.
> It will work only for uni processor i386 arch, other functionality
> will be added soon.
> Please, tell me if some changes need to be made.
> Remarks from you guys are always important and well-come.

Hello Pratyush.
[...]
> @@ -1782,6 +1783,7 @@ pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t mpte, vm_page_t m)
>  	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
>  	++pmap->pm_generation;
>  	m->md.pv_list_count++;
> +	m->object->agg_pv_list_cout++;

cout? Not count?

[...]
> +/* Calculates the proportional RSS and returning the
> + * accrued result. No need to use gettoken/reltoken
> + * BGL is protecting the data.
> + */
> +static __inline u_int
> +vmspace_president_count(struct vmspace *vmspace)
> +{
> +	vm_map_t map = &vmspace->vm_map;
> +	vm_map_entry_t cur;
> +	vm_object_t object;
> +	u_int count = 0;
> +
> +	//	lwkt_gettoken(&vmspace_token);
> +	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
> +		switch(cur->maptype) {
> +		case VM_MAPTYPE_NORMAL:
> +		case VM_MAPTYPE_VPAGETABLE:
> +			if ((object = cur->object.vm_object) == NULL)
> +				break;
> +			if (object->type != OBJT_DEFAULT &&
> +			    object->type != OBJT_SWAP) {
> +				break;
> +			}
> +			count += (object->agg_pv_list_count / object->resident_page_count);

But here it's count :) This won't compile. What's more, this division
should be inversed.

Sorry that I can't take a closer look at your patch.

Hope this helps,
Aggelos





More information about the Kernel mailing list