[EMAIL PROTECTED] c1]# cat /rcfs/shares
res=numtasks,guarantee=-2,limit=-2,total_guarantee=100,max_limit=100
res=mem,guarantee=2500,limit=5000,total_guarantee=100,max_limit=100
[EMAIL PROTECTED] c1]# cat /rcfs/c1/stats
---------Number of tasks stats start---------
Total Over limit failures: 0
Total Over guarantee sucesses: 1
Total Over guarantee failures: 0
Maximum Over limit failures: 0
Maximum Over guarantee sucesses: 0
Maximum Over guarantee failures: 0
---------Number of tasks stats end---------
cur_alloc 1; borrowed 1; cnt_guar -2; cnt_limit -2 cnt_unused -2, unused_guarantee 100, cur_max_limit 0
--------- Memory Resource stats start ---------
Maximum of shrink ever called by the class = 1601
Maximum of pages ever used by the class = 15373
Maximum of pages ever used into the ckrm zone index 0 = 0
Maximum of pages ever used into the ckrm zone index 1 = 15373
Number of pages used(including pages lent to children): 5004
Number of pages guaranteed: 2500
Maximum limit of pages: 5000
Total number of pages available(after serving guarantees to children): 2500
Number of pages lent to children: 0
Number of pages borrowed from the parent: 2504
---------- Memory Resource stats end ----------
[EMAIL PROTECTED] c1]# cat /rcfs/c1/members
4034
[EMAIL PROTECTED] c1]# ps auxw |grep 40349
kai 4034 1.0 1.1 62828 5748 pts/1 R+ 16:48 0:19 ./60.out
root 4196 0.0 0.1 3724 664 pts/4 R+ 17:18 0:00 grep 4034
=====================================
It is quite interesting that stats still reports 5004 pages used, this is above Max limits, would this mean
ckrm_class_limit_ok() call fail then we can't get out of while loop in __alloc_pages() ?
However why ps showing RSS is less then 6M .. ?
Best Regards,
Kai
On 12/1/05, kai unc <[EMAIL PROTECTED]> wrote:
Hi Valérie,
I tested this patch on f03 , it didn't kill the process now, however, the process seems hang inside system call..
My test is as below:
A program to write zero to 60M memory in while loop. My PC have 512M memory, it can hold 7 of such processes,
each has 60M of RSS. Usually, without ckrm, the eighth will cause paging on some of those 7 processes.
With ckrm, I add one of seven process to subclass c1: ( guarantee=10M, limit=20M), then start the eighth process, I see the one
in c1 quickly give up its RSS, however it did not run again. If I do "kill -9" it, it isn't killed.
Can you check? thanks .
========================================
test code: write to 60M memory loop...
void main(void)
{
int size=60;
add = malloc(size*1024*1024);
while(1)
{
bzero(add,size*1024*1024);
}
}
Best Regards,
Kai
On 30 Nov 2005 17:13:26 +0100, Valerie Clement < [EMAIL PROTECTED]> wrote:Hi Kai,
here is a patch that solves the problem of killed processes in a class
when the class reaches its limit.
This patch has been applied on several of our test machines and there
are no more problems with our tests since it was installed.
Feedback and comments are welcome.
Best regards,
Valérie
diff -ruNp -X dontdiff linux-2.6.12.6.orig/mm/page_alloc.c linux-2.6.12.6-vcl/mm/page_alloc.c
--- linux-2.6.12.6.orig/mm/page_alloc.c 2005-11-30 10:08: 42.000000000 +0100
+++ linux-2.6.12.6-vcl/mm/page_alloc.c 2005-11-30 10:14:48.000000000 +0100
@@ -753,8 +753,13 @@ __alloc_pages(unsigned int __nocast gfp_
*/
can_try_harder = (unlikely(rt_task(p)) && !in_interrupt()) || !wait;
- if (!in_interrupt() && !ckrm_class_limit_ok(ckrm_task_memclass(p)))
- return NULL;
+ if (!in_interrupt() && !ckrm_class_limit_ok(ckrm_task_memclass(p))
+ && wait) {
+ /* take a nap, let kswapd refresh zone */
+ blk_congestion_wait(WRITE, HZ/50);
+ while (!ckrm_class_limit_ok(ckrm_task_memclass(p))
+ blk_congestion_wait(WRITE, HZ/50);
+ }
zones = zonelist->zones; /* the list of zones suitable for gfp_mask */
