linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Xu <xuyu@linux.alibaba.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org
Subject: Re: [PATCH] mm, compaction: avoid isolating pinned tmpfs pages
Date: Wed, 28 Apr 2021 22:06:55 +0800	[thread overview]
Message-ID: <b6d1e9f1-0601-6e48-9488-8b674a405a62@linux.alibaba.com> (raw)
In-Reply-To: <e2f0689e00cce7ac73716da14a971a4f1ab88359.1619618267.git.xuyu@linux.alibaba.com>

On 4/28/21 10:00 PM, Xu Yu wrote:
> This makes pinned tmpfs pages bail out early in the process of page
> migration, like what pinned anonymous pages do.
> 
> Signed-off-by: Xu Yu <xuyu@linux.alibaba.com>
> ---
>   mm/compaction.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index e04f4476e68e..78c3b992a1c9 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -964,11 +964,11 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
>   		}
>   
>   		/*
> -		 * Migration will fail if an anonymous page is pinned in memory,
> -		 * so avoid taking lru_lock and isolating it unnecessarily in an
> -		 * admittedly racy check.
> +		 * Migration will fail if an anonymous or tmpfs page is pinned
> +		 * in memory, so avoid taking lru_lock and isolating it
> +		 * unnecessarily in an admittedly racy check.
>   		 */
> -		if (!page_mapping(page) &&
> +		if (!page_is_file_lru(page) &&
>   		    page_count(page) > page_mapcount(page))
Sorry, this patch is flawed, since tmpfs page cache takes an extra page
count.

Please ignore this patch.

>   			goto isolate_fail;
>   
> 

-- 
Thanks,
Yu


      reply	other threads:[~2021-04-28 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 14:00 Xu Yu
2021-04-28 14:06 ` Yu Xu [this message]

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=b6d1e9f1-0601-6e48-9488-8b674a405a62@linux.alibaba.com \
    --to=xuyu@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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