From: Andrew Jones <drjones@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Juan Quintela <quintela@redhat.com>,
Hugh Dickins <hughd@google.com>,
qemu-devel@nongnu.org, linux-kernel@vger.kernel.org,
Orit Wasserman <owasserm@redhat.com>,
Mel Gorman <mgorman@suse.de>, Paolo Bonzini <pbonzini@redhat.com>,
Isaku Yamahata <yamahata@valinux.co.jp>
Subject: Re: [Qemu-devel] [PATCH 1/4] mm: madvise MADV_USERFAULT
Date: Tue, 7 May 2013 13:16:30 +0200 [thread overview]
Message-ID: <20130507111629.GA10720@hawk.usersys.redhat.com> (raw)
In-Reply-To: <1367870221-12676-2-git-send-email-aarcange@redhat.com>
On Mon, May 06, 2013 at 09:56:58PM +0200, Andrea Arcangeli wrote:
> +++ b/mm/madvise.c
> @@ -93,6 +93,21 @@ static long madvise_behavior(struct vm_area_struct * vma,
> if (error)
> goto out;
> break;
> + case MADV_USERFAULT:
> + if (vma->vm_ops) {
> + error = -EINVAL;
> + goto out;
> + }
> + new_flags |= VM_USERFAULT;
> + break;
> + case MADV_NOUSERFAULT:
> + if (vma->vm_ops) {
> + WARN_ON(new_flags & VM_USERFAULT);
> + error = -EINVAL;
> + goto out;
> + }
> + new_flags &= ~VM_USERFAULT;
> + break;
> }
>
> if (new_flags == vma->vm_flags) {
> @@ -405,6 +420,7 @@ madvise_behavior_valid(int behavior)
> case MADV_HUGEPAGE:
> case MADV_NOHUGEPAGE:
> #endif
> + case MADV_USERFAULT:
Missing MADV_NOUSERFAULT: here
> case MADV_DONTDUMP:
> case MADV_DODUMP:
> return 1;
next prev parent reply other threads:[~2013-05-07 11:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 19:56 [Qemu-devel] [PATCH 0/4] madvise(MADV_USERFAULT) & sys_remap_anon_pages() Andrea Arcangeli
2013-05-06 19:56 ` [Qemu-devel] [PATCH 1/4] mm: madvise MADV_USERFAULT Andrea Arcangeli
2013-05-07 11:16 ` Andrew Jones [this message]
2013-05-07 11:34 ` Andrea Arcangeli
2013-05-06 19:56 ` [Qemu-devel] [PATCH 2/4] mm: rmap preparation for remap_anon_pages Andrea Arcangeli
2013-05-06 19:57 ` [Qemu-devel] [PATCH 3/4] mm: swp_entry_swapcount Andrea Arcangeli
2013-05-06 19:57 ` [Qemu-devel] [PATCH 4/4] mm: sys_remap_anon_pages Andrea Arcangeli
2013-05-06 20:01 ` Andrea Arcangeli
2013-05-07 10:07 ` [Qemu-devel] [PATCH 0/4] madvise(MADV_USERFAULT) & sys_remap_anon_pages() Isaku Yamahata
2013-05-07 12:09 ` Andrea Arcangeli
2013-05-07 11:38 ` Andrew Jones
2013-05-07 12:19 ` Andrea Arcangeli
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=20130507111629.GA10720@hawk.usersys.redhat.com \
--to=drjones@redhat.com \
--cc=aarcange@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=yamahata@valinux.co.jp \
/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;
as well as URLs for NNTP newsgroup(s).