linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Charan Teja Reddy <quic_charante@quicinc.com>
Cc: hughd@google.com, akpm@linux-foundation.org, vbabka@suse.cz,
	rientjes@google.com, david@redhat.com, mhocko@suse.com,
	surenb@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Charan Teja Reddy <charante@codeaurora.org>
Subject: Re: [PATCH v2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for shmem
Date: Thu, 2 Dec 2021 14:59:14 +0000	[thread overview]
Message-ID: <YajfQiEHYA6E5CeY@casper.infradead.org> (raw)
In-Reply-To: <1638442253-1591-1-git-send-email-quic_charante@quicinc.com>

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?

  parent reply	other threads:[~2021-12-02 14:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 10:50 [PATCH v2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for shmem Charan Teja Reddy
2021-12-02 13:27 ` Matthew Wilcox
2021-12-02 15:29   ` Charan Teja Kalla
2021-12-02 15:54     ` Matthew Wilcox
2021-12-03 11:55       ` Charan Teja Kalla
2021-12-02 14:59 ` Matthew Wilcox [this message]
2021-12-03 13:02   ` Charan Teja Kalla
2021-12-02 17:54 ` Shakeel Butt
2021-12-06  7:29   ` Charan Teja Kalla
2022-01-05 15:17     ` Charan Teja Kalla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YajfQiEHYA6E5CeY@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=charante@codeaurora.org \
    --cc=david@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=quic_charante@quicinc.com \
    --cc=rientjes@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).