linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hyesoo Yu <hyesoo.yu@samsung.com>
Cc: janghyuck.kim@samsung.com, zhaoyang.huang@unisoc.com,
	jaewon31.kim@gmail.com, david@redhat.com,
	Hyesoo Yu <hyesoo.yu@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/1] mm: gup: avoid CMA page pinning by retrying migration
Date: Thu,  5 Jun 2025 17:04:30 +0900	[thread overview]
Message-ID: <20250605080436.3764686-1-hyesoo.yu@samsung.com> (raw)
In-Reply-To: <CGME20250605080626epcas2p16a1005b2d8992296144759d0e4b91cb8@epcas2p1.samsung.com>

This patch addresses an issue where longterm GUP requests
could inadvertently pin unpinnable pages (such as CMA) when no
migratable folios are found. This regression was introduced by
commit 1aaf8c122918 ("mm: gup: fix infinite loop within __get_longterm_locked").

This patch fixes the logic to return -EAGAIN when unpinnable
pages are detected but no folios could be collected, allowing
migration to be retried instead of incorrectly pinning the page.

This v3 drops the cleanup patch included in v2,
per Andrew Morton's request. It now contains only the regression fix.
The cleanup changes will be proposed separately for the 6.17-rc1.

Hyesoo Yu (1):
  mm: gup: avoid CMA page pinning by retrying migration if no migratable
    page

 mm/gup.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

-- 
2.49.0



       reply	other threads:[~2025-06-05  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250605080626epcas2p16a1005b2d8992296144759d0e4b91cb8@epcas2p1.samsung.com>
2025-06-05  8:04 ` Hyesoo Yu [this message]
     [not found]   ` <CGME20250605080628epcas2p24220eeceef2ae38feeee9d2c18515800@epcas2p2.samsung.com>
2025-06-05  8:04     ` [PATCH v3 1/1] mm: gup: avoid CMA page pinning by retrying migration if no migratable page Hyesoo Yu
2025-06-05  8:39       ` Hyesoo Yu
2025-06-05  9:13         ` David Hildenbrand

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=20250605080436.3764686-1-hyesoo.yu@samsung.com \
    --to=hyesoo.yu@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jaewon31.kim@gmail.com \
    --cc=janghyuck.kim@samsung.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=zhaoyang.huang@unisoc.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