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 <david@redhat.com>
This commit is contained in:
David Hildenbrand 2021-04-13 15:31:47 +02:00 committed by Herton R. Krzesinski
parent e89018a7e5
commit c56f9f652d
1 changed files with 10 additions and 0 deletions

View File

@ -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, unsigned long count,
if (!cma || !cma->count || !cma->bitmap)
goto out;
#ifdef CONFIG_RHEL_DIFFERENCES
pr_info_once("Initial CMA usage detected\n");
#endif /* CONFIG_RHEL_DIFFERENCES */
pr_debug("%s(cma %p, count %lu, align %d)\n", __func__, (void *)cma,
count, align);