From: David Hildenbrand <[email protected]>

mm/cma: mark CMA on x86_64 tech preview and print RHEL-specific infos

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1945002
Upstream: RHEL only

CMA is Tech Preview in RHEL 9 for x86_64; to detect the use of CMA easily,
taint the kernel via mark_tech_preview(). Further print an info when
cma_alloc() is getting called for the first time.

Keep s390x (for vmcp) and ppc64 (for KVM) unmodified, as they have been
automatically creating CMA regions already in RHEL 8.

Signed-off-by: David Hildenbrand <[email protected]>

diff a/mm/cma.c b/mm/cma.c
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -125,6 +125,12 @@ static void __init cma_activate_area(struct cma *cma)
        spin_lock_init(&cma->mem_head_lock);
 #endif
 
+#ifdef CONFIG_RHEL_DIFFERENCES
+       /* s390x and ppc64 has been using CMA already in RHEL 8 as default. */
+       if (!IS_ENABLED(CONFIG_S390) && !IS_ENABLED(CONFIG_PPC64))
+               mark_tech_preview("CMA", NULL);
+#endif /* CONFIG_RHEL_DIFFERENCES */
+
        return;
 
 not_in_zone:
@@ -437,6 +443,10 @@ struct page *cma_alloc(struct cma *cma, size_t count, 
unsigned int align,
        if (!cma || !cma->count || !cma->bitmap)
                return NULL;
 
+#ifdef CONFIG_RHEL_DIFFERENCES
+       pr_info_once("%s() got called for the first time\n", __func__);
+#endif /* CONFIG_RHEL_DIFFERENCES */
+
        pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma,
                 count, align);
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1023
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to