linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Haiqiang Gong (龚海强)" <Haiqiang.Gong@mediatek.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Mike Zhang (张伟伟)" <Mike.Zhang@mediatek.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: Re: 回复: [PATCH] mm/compaction: add check mechanism to avoid cma alloc fail
Date: Wed, 24 Jan 2024 18:40:07 +0000	[thread overview]
Message-ID: <ZbFZh-E7BZEGm_Ed@casper.infradead.org> (raw)
In-Reply-To: <JH0PR03MB8809FC349066C215C28DE119947B2@JH0PR03MB8809.apcprd03.prod.outlook.com>

On Wed, Jan 24, 2024 at 07:20:53AM +0000, Haiqiang Gong (龚海强) wrote:
> > I don't understand.  You say that the memory isn't movable, but then you 
> > say that it's migrated in.  So it was movable, but it's no longer
> > movable after being moved once?  
> Sorry for not expressing clearly
> When doing memory migration, the kernel will determine whether the current 
> page can be moved based on the refcount and mapcount of the current page.
> This memory can be moved during kernel compaction. At this time, refcount 
> is less than or equal to mapcount.
> After this memory is kcompacted and placed in the cma buffer, under 
> certain special conditions, the refcount may be greater than the mapcount
> (ex:the current page is being used by fs), and then migrate will fail.

But that's always true.  Any page that is currently in use might have
its refcount temporarily incremented.  There's nothing special about
pages that belong to a file.  You've basically just prevented all
filesystem memory from being migrated to the CMA area, and that's wrong.

What's special about this page?  Or were you just unlucky?


  reply	other threads:[~2024-01-24 18:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  2:23 [PATCH] mm/compaction: add check mechanism to avoid cma alloc fail Haiqiang Gong
2024-01-22  3:31 ` Matthew Wilcox
2024-01-23 12:14   ` 回复: " Haiqiang Gong (龚海强)
2024-01-24  7:20   ` Haiqiang Gong (龚海强)
2024-01-24 18:40     ` Matthew Wilcox [this message]
2024-01-27 11:03       ` Haiqiang Gong (龚海强)
2024-01-27 16:23         ` Matthew Wilcox
2024-01-22  6:59 ` Baolin Wang
2024-01-24  1:41   ` 回复: " Haiqiang Gong (龚海强)
2024-01-24  7:37   ` Haiqiang Gong (龚海强)

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=ZbFZh-E7BZEGm_Ed@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Haiqiang.Gong@mediatek.com \
    --cc=Mike.Zhang@mediatek.com \
    --cc=akpm@linux-foundation.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=matthias.bgg@gmail.com \
    /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).