lkml.org 
[lkml]   [2020]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting
On Fri, Dec 18, 2020 at 3:04 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
>
> This should do. See below.

Looks fine.

> > Then that second loop very naturally becomes a "do { } while ()" one.
>
> I don't see it. I haven't found a reasonable way to rework it do-while.

Now that you return early for the "HEAD == NULL" case, this loop:

for (; head; head = xas_next_entry(&xas, end_pgoff)) {
[...]
}

very naturally becomes

do {
[...]
} while ((head = xas_next_entry(&xas, end_pgoff)) != NULL);

because the initial test for 'head' being NULL is no longer needed,
and thus it's a lot more logical to just test it at the end of the
loop when we update it.

No?

Maybe I'm missing something silly.

Linus

\
 
 \ /
  Last update: 2020-12-18 19:58    [W:0.127 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site