public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Huang Ying <ying.huang@intel.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	"Luck, Tony" <tony.luck@intel.com>,
	Dean Nelson <dnelson@redhat.com>
Subject: Re: [RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally
Date: Wed, 22 Dec 2010 16:54:06 -0800	[thread overview]
Message-ID: <20101222165406.6e3f8fb0.akpm@linux-foundation.org> (raw)
In-Reply-To: <1293064800.8743.128.camel@yhuang-dev>

On Thu, 23 Dec 2010 08:39:59 +0800
Huang Ying <ying.huang@intel.com> wrote:

> > > --- a/mm/memory.c
> > > +++ b/mm/memory.c
> > > @@ -1449,9 +1449,16 @@ int __get_user_pages(struct task_struct
> > >  				if (ret & VM_FAULT_ERROR) {
> > >  					if (ret & VM_FAULT_OOM)
> > >  						return i ? i : -ENOMEM;
> > > -					if (ret &
> > > -					    (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE|
> > > -					     VM_FAULT_SIGBUS))
> > > +					if (ret & (VM_FAULT_HWPOISON |
> > > +						   VM_FAULT_HWPOISON_LARGE)) {
> > > +						if (i)
> > > +							return i;
> > > +						else if (gup_flags & FOLL_HWPOISON)
> > > +							return -EHWPOISON;
> > > +						else
> > > +							return -EFAULT;
> > > +					}
> > > +					if (ret & VM_FAULT_SIGBUS)
> > 
> > hm, that function is getting a bit unweildy.
> 
> Yes. Do you think the following code is better?
> 
> return i ? i : (gup_flags & FOLL_HWPOISON) ? -EHWPOISON : -EFAULT;

nope ;)

The function just needs to be ripped up and redone somehow.  That's not
an appropriate activity in the context of this patch though.

  reply	other threads:[~2010-12-23  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22  2:51 [RFC 0/3] KVM, HWPoison, unpoison address across rebooting Huang Ying
2010-12-22  2:51 ` [RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for HWPOISON page optionally Huang Ying
2010-12-22 23:07   ` Andrew Morton
2010-12-23  0:39     ` Huang Ying
2010-12-23  0:54       ` Andrew Morton [this message]
2010-12-22  2:51 ` [RFC 2/3] KVM, Replace is_hwpoison_address with get_user_pages_hwpoison Huang Ying
2010-12-22  2:51 ` [RFC 3/3] KVM, HWPoison, unpoison address across rebooting Huang Ying

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=20101222165406.6e3f8fb0.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=dnelson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=tony.luck@intel.com \
    --cc=ying.huang@intel.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