From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: 'Dave McCracken' <dmccr@us.ibm.com>, Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Linux Memory Management <linux-mm@kvack.org>
Subject: RE: [PATCH 1/1] Implement shared page tables
Date: Thu, 1 Sep 2005 21:26:27 -0700 [thread overview]
Message-ID: <200509020427.j824R0g01601@unix-os.sc.intel.com> (raw)
In-Reply-To: <7C49DFF721CB4E671DB260F9@[10.1.1.4]>
Dave McCracken wrote on Tuesday, August 30, 2005 3:13 PM
> This patch implements page table sharing for all shared memory regions that
> span an entire page table page. It supports sharing at multiple page
> levels, depending on the architecture.
In function pt_share_pte():
> + while ((svma = next_shareable_vma(vma, svma, &iter))) {
> + spgd = pgd_offset(svma->vm_mm, address);
> + if (pgd_none(*spgd))
> + continue;
> +
> + spud = pud_offset(spgd, address);
> + if (pud_none(*spud))
> + continue;
> +
> + spmd = pmd_offset(spud, address);
> + if (pmd_none(*spmd))
> + continue;
....
> + page = pmd_page(*spmd);
> + pt_increment_share(page);
> + pmd_populate(vma->vm_mm, pmd, page);
> + }
Do you really have to iterate through all the vma? Can't you just break
out of the while loop on first successful match and populating the pmd?
I would think you will find them to be the same pte page. Or did I miss
some thing?
--- ./mm/ptshare.c.orig 2005-09-01 21:16:35.311915518 -0700
+++ ./mm/ptshare.c 2005-09-01 21:18:24.629296992 -0700
@@ -200,6 +200,7 @@ pt_share_pte(struct vm_area_struct *vma,
page = pmd_page(*spmd);
pt_increment_share(page);
pmd_populate(vma->vm_mm, pmd, page);
+ break;
}
}
pte = pte_alloc_map(vma->vm_mm, pmd, address);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2005-09-02 4:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 22:13 Dave McCracken
2005-08-31 11:44 ` Hugh Dickins
2005-08-31 11:51 ` Arjan van de Ven
2005-08-31 13:42 ` Hugh Dickins
2005-08-31 14:31 ` Martin J. Bligh
2005-08-31 14:41 ` Arjan van de Ven
2005-08-31 15:06 ` Hugh Dickins
2005-08-31 15:39 ` Martin J. Bligh
2005-08-31 16:40 ` Dave McCracken
2005-09-02 1:58 ` Chen, Kenneth W
2005-09-02 16:40 ` Dave McCracken
2005-09-02 4:26 ` Chen, Kenneth W [this message]
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=200509020427.j824R0g01601@unix-os.sc.intel.com \
--to=kenneth.w.chen@intel.com \
--cc=akpm@osdl.org \
--cc=dmccr@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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