On 02.01.25 19:54, Joanne Koong wrote:
On Mon, Dec 30, 2024 at 12:11 PM Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
On Mon, Dec 30, 2024 at 08:52:04PM +0100, David Hildenbrand wrote:
[...]
I'm looking back at some of the discussions in v2 [1] and I'm still
not clear on how memory fragmentation for non-movable pages differs
from memory fragmentation from movable pages and whether one is worse
than the other. Currently fuse uses movable temp pages (allocated with
gfp flags GFP_NOFS | __GFP_HIGHMEM), and these can run into the same
Why are they movable? Do you also specify __GFP_MOVABLE?
If not, they are unmovable and are never allocated from
ZONE_MOVABLE/MIGRATE_CMA -- and usually only from MIGRATE_UNMOVBALE, to
group these unmovable pages.
Yes, these temp pages are non-movable. (Must be a typo in Joanne's
email).
Sorry for the confusion, that should have been "non-movable temp pages".
[...]
I assume not regarding fragmentation.
In general, I see two main issues:
A) We are no longer waiting on writeback, even though we expect in sane
environments that writeback will happen and we it might be worthwhile to
just wait for writeback so we can migrate these folios.
B) We allow turning movable pages to be unmovable, possibly forever/long
time, and there is no way to make them movable again (e.g., cancel
writeback).
I'm wondering if A) is actually a new issue introduced by this change. Can
folios with busy temp pages (writeback cleared on folio, but temp pages are
still around) be migrated? I will look into some details once I'm back from
vacation.
Folios with busy temp pages can be migrated since fuse will clear
writeback on the folio immediately once it's copied to the temp page.
I was rather wondering if there is something else that prevents
migrating these folios: for example, if there is a raised refcount on
the folio while the temp pages exist. If that is not the case, then it
should indeed just work.
To me, these two issues seem like one and the same. No longer waiting
on writeback renders it unmovable, which prevents
compaction/migration.
My suggestion is to just drop the patch related to A as it is not
required for deadlock avoidance. For B, I think we need a long term
solution which is usable by other filesystems as well.
Sounds good. With that, we need to take this patchset out of
mm-unstable or this could lead to migration infinitely waiting on
folio writeback without the migrate patch there.
I want to try triggering it with NFS next week when I am back from PTO,
to see if it is indeed a problem there as well on connection loss.
In any case, having movable pages be turned unmovable due to persistent
writaback is something that must be fixed, not worked around. Likely a
good topic for LSF/MM.
--
Cheers,
David / dhildenb