[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101222165406.6e3f8fb0.akpm@linux-foundation.org>
Date: Wed, 22 Dec 2010 16:54:06 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Huang Ying <ying.huang@...el.com>
Cc: Avi Kivity <avi@...hat.com>, Marcelo Tosatti <mtosatti@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>,
"Luck, Tony" <tony.luck@...el.com>,
Dean Nelson <dnelson@...hat.com>
Subject: Re: [RFC 1/3] mm, Make __get_user_pages return -EHWPOISON for
HWPOISON page optionally
On Thu, 23 Dec 2010 08:39:59 +0800
Huang Ying <ying.huang@...el.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists