Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting

Linus Torvalds
2020-12-19T20:10:16Z

On Sat, Dec 19, 2020 at 4:41 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
>
> Okay, but we only win the NULL check. xas_retry() and xa_is_value() has to
> be repeated in the beginning of the loop.

Yeah.

I wonder if it might make sense to have a "xas_next_entry_rcu()"
function that does something like

while ((entry = xas_next_entry(&xas, end)) != NULL) {
if (xas_retry(entry) || xa_is_value(entry))
continue;
return entry;
}
return NULL;

but that's a question for Willy, and independent of this patch.

I like the patch, and I'll think about it a bit more, but I might
decide to just apply it to get this thing over with.

Otherwise it should probably go into -mm for more testing.

Linus