Welcome! Log In Create A New Profile

Advanced

[nginx] Slab: free pages statistics.

December 07, 2016 02:30PM
details: http://hg.nginx.org/nginx/rev/6e757036e588
branches:
changeset: 6829:6e757036e588
user: Ruslan Ermilov <ru@nginx.com>
date: Wed Dec 07 22:25:37 2016 +0300
description:
Slab: free pages statistics.

diffstat:

src/core/ngx_slab.c | 5 +++++
src/core/ngx_slab.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r 99770a5ea14f -r 6e757036e588 src/core/ngx_slab.c
--- a/src/core/ngx_slab.c Wed Dec 07 22:25:37 2016 +0300
+++ b/src/core/ngx_slab.c Wed Dec 07 22:25:37 2016 +0300
@@ -154,6 +154,7 @@ ngx_slab_init(ngx_slab_pool_t *pool)
}

pool->last = pool->pages + pages;
+ pool->pfree = pages;

pool->log_nomem = 1;
pool->log_ctx = &pool->zero;
@@ -691,6 +692,8 @@ ngx_slab_alloc_pages(ngx_slab_pool_t *po
page->next = NULL;
page->prev = NGX_SLAB_PAGE;

+ pool->pfree -= pages;
+
if (--pages == 0) {
return page;
}
@@ -721,6 +724,8 @@ ngx_slab_free_pages(ngx_slab_pool_t *poo
{
ngx_slab_page_t *prev, *join;

+ pool->pfree += pages;
+
page->slab = pages--;

if (pages) {
diff -r 99770a5ea14f -r 6e757036e588 src/core/ngx_slab.h
--- a/src/core/ngx_slab.h Wed Dec 07 22:25:37 2016 +0300
+++ b/src/core/ngx_slab.h Wed Dec 07 22:25:37 2016 +0300
@@ -42,6 +42,7 @@ typedef struct {
ngx_slab_page_t free;

ngx_slab_stat_t *stats;
+ ngx_uint_t pfree;

u_char *start;
u_char *end;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Slab: free pages statistics.

ru@nginx.com 335 December 07, 2016 02:30PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready