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 */





Reply via email to