mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Lee Revell <rlrevell@joe-job.com>
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: More latency regressions with 2.6.11-rc4-RT-V0.7.39-02
Date: Wed, 23 Feb 2005 19:16:51 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0502231908040.13491@goblin.wat.veritas.com> (raw)
In-Reply-To: <1109182061.16201.6.camel@krustophenia.net>

On Wed, 23 Feb 2005, Lee Revell wrote:
> 
> Did something change recently in the VM that made copy_pte_range and
> clear_page_range a lot more expensive?  I noticed a reference in the
> "Page Table Iterators" thread to excessive overhead introduced by
> aggressive page freeing.  That sure looks like what is going on in
> trace2.  trace1 and trace3 look like big fork latencies associated with
> copy_pte_range.

I'm just about to test this patch below: please give it a try: thanks...

Ingo's patch to reduce scheduling latencies, by checking for lockbreak
in copy_page_range, was in the -VP and -mm patchsets some months ago;
but got preempted by the 4level rework, and not reinstated since.
Restore it now in copy_pte_range - which mercifully makes it easier.

Signed-off-by: Hugh Dickins <hugh@veritas.com>

--- 2.6.11-rc4-bk9/mm/memory.c	2005-02-21 11:32:19.000000000 +0000
+++ linux/mm/memory.c	2005-02-23 18:35:28.000000000 +0000
@@ -328,6 +328,7 @@ static int copy_pte_range(struct mm_stru
 	pte_t *s, *d;
 	unsigned long vm_flags = vma->vm_flags;
 
+again:
 	d = dst_pte = pte_alloc_map(dst_mm, dst_pmd, addr);
 	if (!dst_pte)
 		return -ENOMEM;
@@ -338,11 +339,22 @@ static int copy_pte_range(struct mm_stru
 		if (pte_none(*s))
 			continue;
 		copy_one_pte(dst_mm, src_mm, d, s, vm_flags, addr);
+		/*
+		 * We are holding two locks at this point - either of them
+		 * could generate latencies in another task on another CPU.
+		 */
+		if (need_resched() ||
+		    need_lockbreak(&src_mm->page_table_lock) ||
+		    need_lockbreak(&dst_mm->page_table_lock))
+			break;
 	}
 	pte_unmap_nested(src_pte);
 	pte_unmap(dst_pte);
 	spin_unlock(&src_mm->page_table_lock);
+
 	cond_resched_lock(&dst_mm->page_table_lock);
+	if (addr < end)
+		goto again;
 	return 0;
 }
 

  reply	other threads:[~2005-02-23 19:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23 18:07 Lee Revell
2005-02-23 19:16 ` Hugh Dickins [this message]
2005-02-23 19:36   ` Lee Revell
2005-02-23 20:06     ` Hugh Dickins
2005-02-23 20:10       ` Lee Revell
2005-02-23 20:30       ` Lee Revell
2005-02-23 21:03         ` Hugh Dickins
2005-02-23 22:14           ` Lee Revell
2005-02-23 23:52             ` PPC RT Patch john cooper
2005-02-24  4:20               ` Frank Rowand
2005-02-24 13:56                 ` john cooper
2005-02-23 23:27           ` More latency regressions with 2.6.11-rc4-RT-V0.7.39-02 Nick Piggin
2005-02-24  1:03             ` Lee Revell
2005-02-24  1:29               ` Nick Piggin
2005-02-24  2:24                 ` Lee Revell
2005-02-24  2:41                   ` Nick Piggin
2005-02-24  3:03                     ` Lee Revell
2005-02-23 20:53       ` Hugh Dickins
2005-02-23 22:13         ` Lee Revell
2005-02-24  4:56           ` Hugh Dickins
2005-02-24  6:32             ` Lee Revell
2005-02-24  8:26               ` Hugh Dickins
2005-02-25  3:30                 ` Lee Revell
2005-02-25  5:58                   ` Hugh Dickins
2005-02-25 15:02                     ` Lee Revell
2005-02-23 19:52 ` Lee Revell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0502231908040.13491@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rlrevell@joe-job.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®