[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101112101645.DFF9.A69D9226@jp.fujitsu.com>
Date: Sun, 14 Nov 2010 14:07:08 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: "Steven J. Magnani" <steve@...idescorp.com>
Cc: kosaki.motohiro@...fujitsu.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][RESEND] nommu: yield CPU periodically while disposing large VM
> Depending on processor speed, page size, and the amount of memory a process
> is allowed to amass, cleanup of a large VM may freeze the system for many
> seconds. This can result in a watchdog timeout.
>
> Make sure other tasks receive some service when cleaning up large VMs.
>
> Signed-off-by: Steven J. Magnani <steve@...idescorp.com>
> ---
> diff -uprN a/mm/nommu.c b/mm/nommu.c
> --- a/mm/nommu.c 2010-10-21 07:42:23.000000000 -0500
> +++ b/mm/nommu.c 2010-10-21 07:46:50.000000000 -0500
> @@ -1656,6 +1656,7 @@ SYSCALL_DEFINE2(munmap, unsigned long, a
> void exit_mmap(struct mm_struct *mm)
> {
> struct vm_area_struct *vma;
> + unsigned long next_yield = jiffies + HZ;
>
> if (!mm)
> return;
> @@ -1668,6 +1669,11 @@ void exit_mmap(struct mm_struct *mm)
> mm->mmap = vma->vm_next;
> delete_vma_from_mm(vma);
> delete_vma(mm, vma);
> + /* Yield periodically to prevent watchdog timeout */
> + if (time_after(jiffies, next_yield)) {
> + cond_resched();
> + next_yield = jiffies + HZ;
> + }
If watchdog tiemr interval is less than HZ, this logic doesn't work. right?
If so, I would suggest just remove time_after() and call cond_resched() every time
because cond_resched is no-op if TIF_NEED_RESCHED is not setted.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists