All of lore.kernel.org
 help / color / mirror / Atom feed
* reply: [RFC] pin_user_pages_fast failure count increased
@ 2025-05-22 10:18 黄朝阳 (Zhaoyang Huang)
  2025-05-22 12:22 ` David Hildenbrand
  0 siblings, 1 reply; 27+ messages in thread
From: 黄朝阳 (Zhaoyang Huang) @ 2025-05-22 10:18 UTC (permalink / raw)
  To: Hyesoo Yu, John Hubbard
  Cc: David Hildenbrand, Jaewon Kim, surenb@google.com,
	linux-mm@kvack.org, 康纪滨 (Steve Kang),
	Zhaoyang Huang

>On Mon, Apr 28, 2025 at 02:12:57PM -0700, John Hubbard wrote:
>> On 4/28/25 1:56 PM, David Hildenbrand wrote:
>> > On 28.04.25 22:14, John Hubbard wrote:
>> > > On 4/28/25 8:17 AM, Jaewon Kim wrote:
>> > > > Hi
>> > > >
>> > > > If pin_user_pages_fast does not pin all the requested number of
>> > > > pages, then drivers calling to pin_user_pages_fast should retry
>> > > > until the gup pins all?
>> > > >
>> > >
>> > > Approaches vary, for handling partial success of pin_user_pages().
>> > >
>> > > * Many drivers unpin everything and either bail out entirely, or
>> > > retry pinning the entire original range.
>> >
>> > Hm, unpinning + trying to repin the entire range can easily result
>> > in an endless loop on persistent errors IIRC?
>> >
>>
>> I vaguely recall a limited number of retries, yes.
>>
>> thanks,
>> --
>> John Hubbard
>>
>>
>
>Hi,
>
>I'd like to report a potential issue introduced by a recent change in
>1aaf8c122918 mm: gup: fix infinite loop within __get_longterm_locked
>
>Previously, the call to migrate_longterm_unpinnable_folio() was guarded by the
>collected variable. This meant that if a CMA page was temporarily held in the
>pagevec and failed LRU isolation, it wouldn't be added to the
>movable_page_list, but the collected counter would still be incremented.
There is lru_add_drain_all for dealing with this scenario, so this won't be the case, right?
>
>As a result, migrate_longterm_unpinnable_folio() would return -EAGAIN, and
>the process would be retried until migration of the CMA page succeeded.
>
>However, in the recent patch merged into mainline, the logic now only checks
>whether movable_page_list is empty, and no longer relies on the collected
>count.
>This can cause CMA pages that fail isolation to bypass retry logic and remain
>pinned.
>
>Effectively,long-term pinning is now possible for CMA pages — something that
>previously would have been avoided through repeated attempts.
>
>We've observed this behavior in practice, which has led to issues such as CMA
>allocation failures under memory pressure. This may indicate a regression in
>the logic that prevents pinning of unmovable CMA pages.
>
>I believe this warrants further discussion or possibly a fix to restore the
>intended retry behavior for pages that fail LRU isolation.
>
>Thanks,
>Hyesoo Yu.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-06-04  9:55 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 10:18 reply: [RFC] pin_user_pages_fast failure count increased 黄朝阳 (Zhaoyang Huang)
2025-05-22 12:22 ` David Hildenbrand
     [not found]   ` <CGME20250522130101epcas1p435244c12cfc9bb7895008b8ea98af064@epcms1p3>
     [not found]     ` <CAJrd-UtDD50iN=Yxz4=6kNkAcNAtRFkxhKAbEYiRyyDT-bYPHg@mail.gmail.com>
2025-05-22 13:09       ` Jaewon Kim
2025-05-22 14:06         ` David Hildenbrand
2025-05-22 14:44           ` 김재원
2025-05-22 15:07             ` David Hildenbrand
2025-05-23  2:37               ` 김재원
2025-05-23  2:52                 ` John Hubbard
2025-05-26  7:48                   ` Hyesoo Yu
2025-05-26  8:05                     ` Zhaoyang Huang
2025-05-26  9:33                       ` Hyesoo Yu
2025-05-26  9:38                         ` David Hildenbrand
2025-05-26 11:17                           ` Jaewon Kim
2025-05-26 11:49                             ` Zhaoyang Huang
2025-05-28  1:23                               ` Hyesoo Yu
2025-05-28  2:49                                 ` Zhaoyang Huang
2025-05-28  3:36                                   ` Hyesoo Yu
2025-05-28  7:55                                     ` David Hildenbrand
2025-05-28 10:59                                       ` Zhaoyang Huang
2025-05-28 12:57                                         ` David Hildenbrand
2025-06-03 13:12                                         ` David Hildenbrand
2025-06-04  1:04                                           ` Zhaoyang Huang
2025-06-04  9:12                                             ` David Hildenbrand
2025-06-04  9:41                                               ` Zhaoyang Huang
2025-06-04  9:48                                                 ` David Hildenbrand
2025-06-04  9:53                                                   ` Hyesoo Yu
2025-05-23  2:48               ` John Hubbard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.