All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Aboorva Devarajan <aboorvad@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Oscar Salvador <osalvador@suse.de>,
	Michal Hocko <mhocko@suse.com>, Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: Re: [RFC PATCH 0/2] mm/memory_hotplug: bound offline retry loops with a configurable limit
Date: Thu, 30 Jul 2026 16:12:06 +0200	[thread overview]
Message-ID: <38eb2487-3ce0-4d02-a7b4-d5b81e249ef4@kernel.org> (raw)
In-Reply-To: <1260a5746d88eff27565d506f69cf74bd766abc1.camel@linux.ibm.com>


>> Usually that happens when we race offlining (has_unmovable_pages()) with page
>> allocation, and failing on unmovable pages is actually perfectly fine.
>>
>> But for ZONE_MOVABLE we should keep retrying, because some pages might only look
>> temporarily unmovable.
>>
>> So that would be the low hanging fruit: on !ZONE_MOVABLE, fail faster.
> 
> This handles scenarios like Case 1. A page can still be allocated from the range after
> isolation and become slab. When test_pages_isolated() fails, we can re-check that
> page with page_is_unmovable() and return -EBUSY if it's unmovable. I'm currently testing this approach
> will send a patch for review.

Yes, and that we should handle. It's a known race and we should just fail faster
in that case. !ZONE_MOVABLE.

> 
> Case 2 is different. The page is on the LRU, so it is considered movable and the fast-fail condition abovewon't be triggered. Instead page migration keeps failing, causing
> offline_pages() to retry indefinitely
> and can hang forever. This could be handled with a timeout or a user
> policy in the application that
> initiated the hotplug operation (signals). However, for the kworker
> paths that trigger memory
> offlining (ACPI remove, etc.), should this instead be handled by the
> driver rather than relying on
> offline_pages(), similar to virtio-mem?

If it's on ZONE_MOVABLE, then we should figure out why it keeps failing forever
and try fixing that instead.

Above you write: "I can also trigger it in a VM by hot-adding a DIMM, pinning a
page and removing the DIMM."

Anybody who intends to take a longterm pin must be using FOLL_LONGTERM, which
will take care of exactly this condition: migrating memory out of ZONE_MOVABLE
first.

So which interface does you reproducer use to trigger pinning?

-- 
Cheers,

David

      reply	other threads:[~2026-07-30 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  7:48 [RFC PATCH 0/2] mm/memory_hotplug: bound offline retry loops with a configurable limit Aboorva Devarajan
2026-07-22  7:48 ` [RFC PATCH 1/2] " Aboorva Devarajan
2026-07-22  7:48 ` [RFC PATCH 2/2] selftests/mm: add pc-dimm ACPI eject selftest for offline_migrate_max_passes Aboorva Devarajan
2026-07-22 12:08 ` [RFC PATCH 0/2] mm/memory_hotplug: bound offline retry loops with a configurable limit David Hildenbrand (Arm)
2026-07-22 12:29   ` David Hildenbrand (Arm)
2026-07-29  2:11     ` Aboorva Devarajan
2026-07-30 14:12       ` David Hildenbrand (Arm) [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=38eb2487-3ce0-4d02-a7b4-d5b81e249ef4@kernel.org \
    --to=david@kernel.org \
    --cc=aboorvad@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=liam@infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=ritesh.list@gmail.com \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.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 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.