On 2/8/21 4:02 PM, Matthew Wilcox wrote: > On Mon, Feb 08, 2021 at 03:18:27PM -0700, Jens Axboe wrote: >> + rcu_read_lock(); >> + xas_for_each(&xas, head, max) { >> + if (xas_retry(&xas, head)) >> + continue; >> + if (xa_is_value(head)) >> + continue; >> + page = find_subpage(head, xas.xa_index); >> + if (PageDirty(page) || PageLocked(page) || PageWriteback(page)) >> + break; >> + page = NULL; >> + } >> + rcu_read_unlock(); > > There's no need to find the sub-page for any of these three conditions -- > the bit will be set on the head page. Gotcha, that makes it simpler. I'll make the edit. -- Jens Axboe