lkml.org 
[lkml]   [2019]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Unsigned 'nr_pages' always larger than zero
On Wed, 16 Oct 2019 17:07:44 +0800 zhong jiang <zhongjiang@huawei.com> wrote:

> >> --- a/mm/gup.c~a
> >> +++ a/mm/gup.c
> >> @@ -1450,6 +1450,7 @@ static long check_and_migrate_cma_pages(
> >> bool drain_allow = true;
> >> bool migrate_allow = true;
> >> LIST_HEAD(cma_page_list);
> >> + long ret;
> >> check_again:
> >> for (i = 0; i < nr_pages;) {
> >> @@ -1511,17 +1512,18 @@ check_again:
> >> * again migrating any new CMA pages which we failed to isolate
> >> * earlier.
> >> */
> >> - nr_pages = __get_user_pages_locked(tsk, mm, start, nr_pages,
> >> + ret = __get_user_pages_locked(tsk, mm, start, nr_pages,
> >> pages, vmas, NULL,
> >> gup_flags);
> >> - if ((nr_pages > 0) && migrate_allow) {
> >> + nr_pages = ret;
> >> + if (ret > 0 && migrate_allow) {
> >> drain_allow = true;
> >> goto check_again;
> >> }
> >> }
> >> - return nr_pages;
> >> + return ret;
> >> }
> >> #else
> >> static long check_and_migrate_cma_pages(struct task_struct *tsk,
> >>
> >
> > +1 for this approach, please.
> >
> >
> > thanks,
> Hi, Andrew
>
> I didn't see the fix for the issue in the upstream. Your proposal should be
> appiled to upstream. Could you appiled the patch or repost by me ?

Forgotten about it ;) Please send a patch sometime?

\
 
 \ /
  Last update: 2019-10-17 02:50    [W:0.110 / U:5.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site