lkml.org 
[lkml]   [2018]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] mm/gup_benchmark: handle gup failures
On Sat, Apr 07, 2018 at 01:08:43PM -0700, Linus Torvalds wrote:
> On Thu, Apr 5, 2018 at 2:03 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > nr = get_user_pages_fast(addr, nr, gup->flags & 1, pages + i);
> > - i += nr;
> > + if (nr > 0)
> > + i += nr;
>
> Can we just make this robust while at it, and just make it
>
> if (nr <= 0)
> break;
>
> instead? Then it doesn't care about zero vs negative error, and
> wouldn't get stuck in an endless loop if it got zero.
>
> Linus

I don't mind though it alredy breaks out on the next cycle:

if (nr != gup->nr_pages_per_call)
break;

the only issue is i getting corrupted when nr < 0;



\
 
 \ /
  Last update: 2018-04-08 05:13    [W:0.280 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site