From: "Jeff Chua" <jeff.chua.linux@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: ecollins@vmware.com,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
support@vmware.com
Subject: Re: Linux 2.6.26-rc7
Date: Mon, 23 Jun 2008 23:21:09 +0800 [thread overview]
Message-ID: <b6a2187b0806230821g6759d6dbo2ec1c7720cf86209@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.1.10.0806221003360.2926@woody.linux-foundation.org>
On Mon, Jun 23, 2008 at 1:26 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> So assuming it's not the XIP fix, you could try this patch instead. It
> replaces the (insane) use of VM_LOCKED with VM_SHARED (which is a lot more
> meaningful for the case of ZERO_PAGE, but strictly speaking probably
> doesn't matter either), and it teaches it about the fact that
> non-anonymous pages can be populated not just with the "->fault" handler,
> but with "->nopfn" too.
>
> I really don't think it's due to this (nobody sane really uses '->nopfn'),
> but if the XIP disabling patch doesn't make a difference, give it a try.
Linus,
This one fixes the problem! So, it's something strange that VMware is
doing, but anyway, glad you fix it!!!
Thanks for the patch.
Jeff.
> (Most of the patch is obviously the fact that I moved the conditionals
> into a helper inline function to make the dang thing more readable). The
> actual change is trivial.
>
> Linus
>
> ---
> mm/memory.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 9aefaae..8c5675f 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1045,6 +1045,15 @@ no_page_table:
> return page;
> }
>
> +/* Can we do the FOLL_ANON optimization? */
> +static inline int use_zero_page(struct vm_area_struct *vma)
> +{
> + if (vma->vm_flags & VM_SHARED)
> + return 0;
> + return !vma->vm_ops ||
> + (!vma->vm_ops->fault && !vma->vm_ops->nopfn);
> +}
> +
> int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> unsigned long start, int len, int write, int force,
> struct page **pages, struct vm_area_struct **vmas)
> @@ -1119,8 +1128,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> foll_flags = FOLL_TOUCH;
> if (pages)
> foll_flags |= FOLL_GET;
> - if (!write && !(vma->vm_flags & VM_LOCKED) &&
> - (!vma->vm_ops || !vma->vm_ops->fault))
> + if (!write && use_zero_page(vma))
> foll_flags |= FOLL_ANON;
>
> do {
>
next prev parent reply other threads:[~2008-06-23 15:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 23:42 Linus Torvalds
2008-06-21 9:55 ` 2.6.26-rc7: x86 build error Adrian Bunk
2008-06-21 17:01 ` Johannes Weiner
2008-06-22 7:12 ` Linux 2.6.26-rc7 Jeff Chua
2008-06-22 16:29 ` Linus Torvalds
2008-06-22 17:26 ` Linus Torvalds
2008-06-23 15:21 ` Jeff Chua [this message]
2008-06-23 15:18 ` Jeff Chua
2008-06-22 16:58 ` Arjan van de Ven
2008-06-23 15:26 ` Jeff Chua
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=b6a2187b0806230821g6759d6dbo2ec1c7720cf86209@mail.gmail.com \
--to=jeff.chua.linux@gmail.com \
--cc=ecollins@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=support@vmware.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®