lkml.org 
[lkml]   [2010]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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.



\
 
 \ /
  Last update: 2010-12-23 01:57    [W:0.033 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site