Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-06-03 17:53:03 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-06-03 17:53:03 +0400
commitafb4aafc6e42781068ce3f23d22fd6e2012787c7 (patch)
tree6e24e4615508e24778460240cdb850499ebd6315 /src/core/ngx_slab.h
parent9b5a17b5e23e8e7c94d84eb85044370e38887849 (diff)
Core: slab allocator free pages defragmentation.
Large allocations from a slab pool result in free page blocks being fragmented, eventually leading to a situation when no further allocation larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang.
Diffstat (limited to 'src/core/ngx_slab.h')
-rw-r--r--src/core/ngx_slab.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ngx_slab.h b/src/core/ngx_slab.h
index 5735e3bb3..1ee65d531 100644
--- a/src/core/ngx_slab.h
+++ b/src/core/ngx_slab.h
@@ -29,6 +29,7 @@ typedef struct {
size_t min_shift;
ngx_slab_page_t *pages;
+ ngx_slab_page_t *last;
ngx_slab_page_t free;
u_char *start;