Thread (39 messages) 39 messages, 4 authors, 2020-07-06

Re: [PATCH v3 4/8] mm/hugetlb: make hugetlb migration callback CMA aware

From: Joonsoo Kim <hidden>
Date: 2020-06-30 07:22:40
Also in: lkml

2020년 6월 30일 (화) 오후 3:42, Michal Hocko [off-list ref]님이 작성:
On Tue 30-06-20 15:30:04, Joonsoo Kim wrote:
quoted
2020년 6월 29일 (월) 오후 4:55, Michal Hocko [off-list ref]님이 작성:
[...]
quoted
quoted
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 57ece74e3aae..c1595b1d36f3 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1092,10 +1092,14 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask,
 /* Movability of hugepages depends on migration support. */
 static inline gfp_t htlb_alloc_mask(struct hstate *h)
 {
+       gfp_t gfp;
+
        if (hugepage_movable_supported(h))
-               return GFP_HIGHUSER_MOVABLE;
+               gfp = GFP_HIGHUSER_MOVABLE;
        else
-               return GFP_HIGHUSER;
+               gfp = GFP_HIGHUSER;
+
+       return current_gfp_context(gfp);
 }

 static struct page *dequeue_huge_page_vma(struct hstate *h,
If we even fix this general issue for other allocations and allow a
better CMA exclusion then it would be implemented consistently for
everybody.
Yes, I have reviewed the memalloc_nocma_{} APIs and found the better way
for CMA exclusion. I will do it after this patch is finished.
quoted
Does this make more sense to you are we still not on the same page wrt
to the actual problem?
Yes, but we have different opinions about it. As said above, I will make
a patch for better CMA exclusion after this patchset. It will make
code consistent.
I'd really appreciate it if you wait until then.
As I've said I would _prefer_ simplicity over "correctness" if it is only
partial and hard to reason about from the userspace experience but this
is not something I would _insist_ on. If Mike as a maintainer of the
code is ok with that then I will not stand in the way.
Okay.
But please note that a missing current_gfp_context inside
htlb_alloc_mask is a subtle bug. I do not think it matters right now but
with a growing use of scoped apis this might actually hit some day so I
believe we want to have it in place.
Okay. I will keep in mind and consider it when fixing CMA exclusion on the
other patchset.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help