[Devel] Re: [RFC][ only for review ] memory controller bacground reclaim [3/5] high/low watermark support in res_counter

YAMAMOTO Takashi yamamoto at valinux.co.jp
Wed Nov 28 18:56:08 PST 2007


> This patch adds high/low watermark parameter to res_counter.
> splitted out from YAMAMOTO's background page reclaim for memory cgroup set.

thanks.

> +	 * Watermarks
> +	 * Should be changed automatically when the limit is changed and
> +	 * keep low < high < limit.
> +	 */
> +	unsigned long long high_watermark;
> +	unsigned long long low_watermark;
> +	/*

do you have any specific reason not to allow low == high == limit?
if you want to ensure low < high < limit, it's better to make the
default values below meet the condition as well.
to me, it seems weird to prevent users from making these values back to
the default.

YAMAMOTO Takashi

> @@ -17,6 +17,9 @@
>  {
>  	spin_lock_init(&counter->lock);
>  	counter->limit = (unsigned long long)LLONG_MAX;
> +	counter->low_watermark = (unsigned long long)LLONG_MAX;
> +	counter->high_watermark = (unsigned long long)LLONG_MAX;
> +	counter->watermark_state = RES_WATERMARK_BELOW_LOW;
>  }
>  
>  int res_counter_charge_locked(struct res_counter *counter, unsigned long val)
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list