2007-08-13 00:33:59

by YAMAMOTO Takashi

[permalink] [raw]
Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4)

> Choose if we want cached pages to be accounted or not. By default both
> are accounted for. A new set of tunables are added.
>
> echo -n 1 > mem_control_type
>
> switches the accounting to account for only mapped pages
>
> echo -n 2 > mem_control_type
>
> switches the behaviour back

MEM_CONTAINER_TYPE_ALL is 3, not 2.

YAMAMOTO Takashi

> +enum {
> + MEM_CONTAINER_TYPE_UNSPEC = 0,
> + MEM_CONTAINER_TYPE_MAPPED,
> + MEM_CONTAINER_TYPE_CACHED,
> + MEM_CONTAINER_TYPE_ALL,
> + MEM_CONTAINER_TYPE_MAX,
> +} mem_control_type;
> +
> +static struct mem_container init_mem_container;

> + mem = rcu_dereference(mm->mem_container);
> + if (mem->control_type == MEM_CONTAINER_TYPE_ALL)
> + return mem_container_charge(page, mm);
> + else
> + return 0;


2007-08-13 06:04:37

by YAMAMOTO Takashi

[permalink] [raw]
Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4)

> YAMAMOTO Takashi wrote:
> >> Choose if we want cached pages to be accounted or not. By default both
> >> are accounted for. A new set of tunables are added.
> >>
> >> echo -n 1 > mem_control_type
> >>
> >> switches the accounting to account for only mapped pages
> >>
> >> echo -n 2 > mem_control_type
> >>
> >> switches the behaviour back
> >
> > MEM_CONTAINER_TYPE_ALL is 3, not 2.
> >
>
> Thanks, I'll fix the comment on the top.
>
> > YAMAMOTO Takashi
> >
> >> +enum {
> >> + MEM_CONTAINER_TYPE_UNSPEC = 0,
> >> + MEM_CONTAINER_TYPE_MAPPED,
> >> + MEM_CONTAINER_TYPE_CACHED,

what's MEM_CONTAINER_TYPE_CACHED, btw?
it seems that nothing distinguishes it from MEM_CONTAINER_TYPE_MAPPED.

YAMAMOTO Takashi

2007-08-13 06:18:48

by Balbir Singh

[permalink] [raw]
Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4)

YAMAMOTO Takashi wrote:
>> YAMAMOTO Takashi wrote:
>>>> Choose if we want cached pages to be accounted or not. By default both
>>>> are accounted for. A new set of tunables are added.
>>>>
>>>> echo -n 1 > mem_control_type
>>>>
>>>> switches the accounting to account for only mapped pages
>>>>
>>>> echo -n 2 > mem_control_type
>>>>
>>>> switches the behaviour back
>>> MEM_CONTAINER_TYPE_ALL is 3, not 2.
>>>
>> Thanks, I'll fix the comment on the top.
>>
>>> YAMAMOTO Takashi
>>>
>>>> +enum {
>>>> + MEM_CONTAINER_TYPE_UNSPEC = 0,
>>>> + MEM_CONTAINER_TYPE_MAPPED,
>>>> + MEM_CONTAINER_TYPE_CACHED,
>
> what's MEM_CONTAINER_TYPE_CACHED, btw?
> it seems that nothing distinguishes it from MEM_CONTAINER_TYPE_MAPPED.
>

The important types are currently MEM_CONTAINER_TYPE_MAPPED and MEM_CONTAINER_TYPE_ALL.
I added the types for future use (may be for finer accounting of types, later).

> YAMAMOTO Takashi


--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL

2007-08-13 12:35:30

by Balbir Singh

[permalink] [raw]
Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4)

YAMAMOTO Takashi wrote:
>> Choose if we want cached pages to be accounted or not. By default both
>> are accounted for. A new set of tunables are added.
>>
>> echo -n 1 > mem_control_type
>>
>> switches the accounting to account for only mapped pages
>>
>> echo -n 2 > mem_control_type
>>
>> switches the behaviour back
>
> MEM_CONTAINER_TYPE_ALL is 3, not 2.
>

Thanks, I'll fix the comment on the top.

> YAMAMOTO Takashi
>
>> +enum {
>> + MEM_CONTAINER_TYPE_UNSPEC = 0,
>> + MEM_CONTAINER_TYPE_MAPPED,
>> + MEM_CONTAINER_TYPE_CACHED,
>> + MEM_CONTAINER_TYPE_ALL,
>> + MEM_CONTAINER_TYPE_MAX,
>> +} mem_control_type;
>> +
>> +static struct mem_container init_mem_container;
>
>> + mem = rcu_dereference(mm->mem_container);
>> + if (mem->control_type == MEM_CONTAINER_TYPE_ALL)
>> + return mem_container_charge(page, mm);
>> + else
>> + return 0;


--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL