[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YajfQiEHYA6E5CeY@casper.infradead.org>
Date: Thu, 2 Dec 2021 14:59:14 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Charan Teja Reddy <quic_charante@...cinc.com>
Cc: hughd@...gle.com, akpm@...ux-foundation.org, vbabka@...e.cz,
rientjes@...gle.com, david@...hat.com, mhocko@...e.com,
surenb@...gle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Charan Teja Reddy <charante@...eaurora.org>
Subject: Re: [PATCH v2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for
shmem
On Thu, Dec 02, 2021 at 04:20:53PM +0530, Charan Teja Reddy wrote:
> +static void shmem_isolate_pages_range(struct address_space *mapping, loff_t start,
> + loff_t end, struct list_head *list)
> +{
> + XA_STATE(xas, &mapping->i_pages, start);
> + struct page *page;
> +
> + rcu_read_lock();
> + xas_for_each(&xas, page, end) {
> + if (xas_retry(&xas, page))
> + continue;
> + if (xa_is_value(page))
> + continue;
> + if (!get_page_unless_zero(page))
> + continue;
> + if (isolate_lru_page(page))
> + continue;
> +
> + list_add(&page->lru, list);
> + inc_node_page_state(page, NR_ISOLATED_ANON +
> + page_is_file_lru(page));
... what if the page is a THP?
Powered by blists - more mailing lists