LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Paul Mundt <lethal@linux-sh.org>,
	Christoph Lameter <clameter@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: [patch -mm] smaps: flush tlb only once for each vma
Date: Tue, 13 Feb 2007 20:29:54 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0702132025310.11450@chino.kir.corp.google.com> (raw)

Flush the entire user address space from the TLB for each VMA in the 
task_struct list when clearing reference bits with /proc/pid/clear_refs.  
It's more efficient than flushing each page individually depending on 
pte_young().

Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 fs/proc/task_mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -276,7 +276,6 @@ static void clear_refs_one_pmd(struct vm_area_struct *vma, pmd_t *pmd,
 		if (pte_young(ptent)) {
 			ptent = pte_mkold(ptent);
 			set_pte_at(vma->vm_mm, addr, pte, ptent);
-			flush_tlb_page(vma, addr);
 		}
 		ClearPageReferenced(page);
 	}
@@ -358,6 +357,7 @@ void clear_refs_smap(struct mm_struct *mm)
 	for (vma = mm->mmap; vma; vma = vma->vm_next)
 		if (vma->vm_mm && !is_vm_hugetlb_page(vma))
 			for_each_pmd(vma, clear_refs_one_pmd, NULL);
+	flush_tlb_mm(mm);
 	up_read(&mm->mmap_sem);
 }
 

                 reply	other threads:[~2007-02-14  4:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.64.0702132025310.11450@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [patch -mm] smaps: flush tlb only once for each vma' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).