From: Alex Markuze Date: Wed, 19 Mar 2025 11:43:49 +0000 (+0000) Subject: more debug info X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dfb95574503f0bd6a572abaf2e23a6cabada0882;p=ceph-client.git more debug info --- diff --git a/include/linux/ceph/ceph_san_pagefrag.h b/include/linux/ceph/ceph_san_pagefrag.h index bd6c285af351..2e8ebc064211 100644 --- a/include/linux/ceph/ceph_san_pagefrag.h +++ b/include/linux/ceph/ceph_san_pagefrag.h @@ -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); diff --git a/net/ceph/ceph_san_logger.c b/net/ceph/ceph_san_logger.c index 2cc29e1e7e1a..39767326601e 100644 --- a/net/ceph/ceph_san_logger.c +++ b/net/ceph/ceph_san_logger.c @@ -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); diff --git a/net/ceph/ceph_san_pagefrag.c b/net/ceph/ceph_san_pagefrag.c index 873197e7ca39..09dd857c8a28 100644 --- a/net/ceph/ceph_san_pagefrag.c +++ b/net/ceph/ceph_san_pagefrag.c @@ -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);