]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
more debug info
authorAlex Markuze <amarkuze@redhat.com>
Wed, 19 Mar 2025 11:43:49 +0000 (11:43 +0000)
committerAlex Markuze <amarkuze@redhat.com>
Wed, 19 Mar 2025 11:44:16 +0000 (11:44 +0000)
include/linux/ceph/ceph_san_pagefrag.h
net/ceph/ceph_san_logger.c
net/ceph/ceph_san_pagefrag.c

index bd6c285af3510101af391a827954a1f8d2f215f4..2e8ebc06421130ef6897061935ead1fc6ed19149 100644 (file)
@@ -17,6 +17,8 @@ struct cephsan_pagefrag {
     unsigned int tail;
     unsigned int alloc_count;
     int active_elements;
+    unsigned int wrap_to_end;   /* Count of allocations that filled to end */
+    unsigned int wrap_around;    /* Count of allocations that wrapped around */
 };
 
 int cephsan_pagefrag_init(struct cephsan_pagefrag *pf);
index 2cc29e1e7e1af99edcc85c95ca0f71c7f2ffe231..39767326601e9a3b7bd64634989f94cb2f14e47c 100644 (file)
@@ -162,6 +162,8 @@ void ceph_san_log(const char *file, const char *func, unsigned int line, const c
                   ctx->pf.active_elements, ctx->pf.alloc_count);
             pr_err("  entry poison: %llx, len: %u\n",
                   entry->debug_poison, entry->len);
+            pr_err("  wrap_to_end: %u, wrap_around: %u\n",
+                  ctx->pf.wrap_to_end, ctx->pf.wrap_around);
             BUG();
         }
         cephsan_pagefrag_free(&ctx->pf, entry->len);
index 873197e7ca396b125e94bf67a121084fff99e6a0..09dd857c8a2803df1351e0be12011d02159ceec9 100644 (file)
@@ -22,6 +22,8 @@ int cephsan_pagefrag_init(struct cephsan_pagefrag *pf)
     pf->tail = 0;
     pf->active_elements = 0;
     pf->alloc_count = 0;
+    pf->wrap_to_end = 0;
+    pf->wrap_around = 0;
     return 0;
 }
 EXPORT_SYMBOL(cephsan_pagefrag_init);
@@ -43,6 +45,8 @@ int cephsan_pagefrag_init_with_buffer(struct cephsan_pagefrag *pf, void *buffer,
     pf->tail = 0;
     pf->active_elements = 0;
     pf->alloc_count = 0;
+    pf->wrap_to_end = 0;
+    pf->wrap_around = 0;
     return 0;
 }
 EXPORT_SYMBOL(cephsan_pagefrag_init_with_buffer);
@@ -81,6 +85,7 @@ u64 cephsan_pagefrag_alloc(struct cephsan_pagefrag *pf, unsigned int n)
         if (unlikely(delta < 64)) {
             n += delta;
             pf->head = 0;
+            pf->wrap_to_end++;
             return ((u64)n << 32) | prev_head;
         }
         pf->head += n;
@@ -91,6 +96,7 @@ u64 cephsan_pagefrag_alloc(struct cephsan_pagefrag *pf, unsigned int n)
             pf->head = n;
             pf->alloc_count++;
             pf->active_elements++;
+            pf->wrap_around++;
             return ((u64)(delta + n) << 32) | prev_head;
         } else {
             return 0;
@@ -190,6 +196,8 @@ void cephsan_pagefrag_reset(struct cephsan_pagefrag *pf)
     pf->tail = 0;
     pf->alloc_count = 0;
     pf->active_elements = 0;
+    pf->wrap_to_end = 0;
+    pf->wrap_around = 0;
     spin_unlock(&pf->lock);
 }
 EXPORT_SYMBOL(cephsan_pagefrag_reset);