diff mbox series

答复: [External Mail]+ mm-cma-print-total-and-used-count-in-cma_alloc.patch added to mm-unstable branch

Message ID e02aa8d24a254f36af5132925be4075b@xiaomi.com (mailing list archive)
State New
Headers show
Series 答复: [External Mail]+ mm-cma-print-total-and-used-count-in-cma_alloc.patch added to mm-unstable branch | expand

Commit Message

高翔 Sept. 26, 2024, 11:19 p.m. UTC
So now we're ready to merge into master?

Comments

Andrew Morton Sept. 27, 2024, 12:17 a.m. UTC | #1
On Thu, 26 Sep 2024 23:19:25 +0000 高翔 <gaoxiang17@xiaomi.com> wrote:

> So now we're ready to merge into master?
> 

Nope.  There's a review question I'd like answered and the patch should
go through our regular integration testing.  This is 6.13 material.
高翔 Sept. 27, 2024, 12:46 a.m. UTC | #2
If you pass the regular integration testing, it will be classified as 6.13 material, and then finally merge into version 6.13?
David Hildenbrand Sept. 27, 2024, 12:16 p.m. UTC | #3
On 27.09.24 02:46, 高翔 wrote:
> If you pass the regular integration testing, it will be classified as 
> 6.13 material, and then finally merge into version 6.13?

That's the usual flow.
diff mbox series

Patch

--- a/mm/cma.c~mm-cma-print-total-and-used-count-in-cma_alloc
+++ a/mm/cma.c
@@ -403,6 +403,17 @@  static void cma_debug_show_areas(struct
        spin_unlock_irq(&cma->lock);
 }

+static unsigned long cma_get_used(struct cma *cma)
+{
+       unsigned long used;
+
+       spin_lock_irq(&cma->lock);
+       used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma));
+       spin_unlock_irq(&cma->lock);
+
+       return used << cma->order_per_bit;
+}
+
 static struct page *__cma_alloc(struct cma *cma, unsigned long count,
                                unsigned int align, gfp_t gfp)
 {
@@ -420,8 +431,8 @@  static struct page *__cma_alloc(struct c
        if (!cma || !cma->count || !cma->bitmap)
                return page;

-       pr_debug("%s(cma %p, name: %s, count %lu, align %d)\n", __func__,
-               (void *)cma, cma->name, count, align);
+       pr_debug("%s(cma %p, name: %s, total count %lu, used count: %lu, request count %lu, align %d)\n", __func__,
+               (void *)cma, cma->name, cma->count, cma_get_used(cma), count, align);

        if (!count)
                return page;