Re: [PATCH 1/3] mm: provide filemap_range_needs_writeback() helper
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-02-08 23:03:14
Also in:
linux-mm
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-02-08 23:03:14
Also in:
linux-mm
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.