Re: [PATCH 1/7] memcg: add high/low watermark to res_counter
From: KAMEZAWA Hiroyuki <hidden>
Date: 2011-05-06 05:36:41
On Mon, 2 May 2011 14:37:41 +0530 Balbir Singh [off-list ref] wrote:
* KAMEZAWA Hiroyuki [off-list ref] [2011-04-25 18:28:49]:
res_counter_set_high_wmark_limit(&mem->res, limit);
quoted
+ } else { + u64 low_wmark, high_wmark, low_distance; + if (mem->high_wmark_distance <= HILOW_DISTANCE) + low_distance = mem->high_wmark_distance / 2; + else + low_distance = HILOW_DISTANCE; + if (low_distance < PAGE_SIZE * 2) + low_distance = PAGE_SIZE * 2; + + low_wmark = limit - low_distance; + high_wmark = limit - mem->high_wmark_distance; + + res_counter_set_low_wmark_limit(&mem->res, low_wmark); + res_counter_set_high_wmark_limit(&mem->res, high_wmark); + } +} +I've not seen the documentation patch, but it might be good to have some comments with what to expect the watermarks to be and who sets up up high_wmark_distance.
I'll refine these namings. Thanks, -Kame -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>