| 33 | #include "records/RecCore.h" |
| 34 | |
| 35 | void |
| 36 | ink_event_system_init(ts::ModuleVersion v) |
| 37 | { |
| 38 | ink_release_assert(v.check(EVENT_SYSTEM_MODULE_INTERNAL_VERSION)); |
| 39 | int iobuffer_advice = 0; |
| 40 | |
| 41 | // For backwards compatibility make sure to allow thread_freelist_size |
| 42 | // This needs to change in 6.0 |
| 43 | REC_EstablishStaticConfigInt32(thread_freelist_high_watermark, "proxy.config.allocator.thread_freelist_size"); |
| 44 | |
| 45 | REC_EstablishStaticConfigInt32(thread_freelist_low_watermark, "proxy.config.allocator.thread_freelist_low_watermark"); |
| 46 | |
| 47 | int chunk_sizes[DEFAULT_BUFFER_SIZES] = {0}; |
| 48 | char *chunk_sizes_string = REC_ConfigReadString("proxy.config.allocator.iobuf_chunk_sizes"); |
| 49 | if (chunk_sizes_string && !parse_buffer_chunk_sizes(chunk_sizes_string, chunk_sizes)) { |
| 50 | // If we can't parse the string then we can't be sure of the chunk sizes so just exit |
| 51 | Fatal("Failed to parse proxy.config.allocator.iobuf_chunk_sizes"); |
| 52 | } |
| 53 | ats_free(chunk_sizes_string); |
| 54 | |
| 55 | bool use_hugepages = ats_hugepage_enabled(); |
| 56 | |
| 57 | #ifdef MADV_DONTDUMP // This should only exist on Linux 3.4 and higher. |
| 58 | RecBool dont_dump_enabled = true; |
| 59 | RecGetRecordBool("proxy.config.allocator.dontdump_iobuffers", &dont_dump_enabled, false); |
| 60 | |
| 61 | if (dont_dump_enabled) { |
| 62 | iobuffer_advice |= MADV_DONTDUMP; |
| 63 | } |
| 64 | #endif |
| 65 | |
| 66 | init_buffer_allocators(iobuffer_advice, chunk_sizes, use_hugepages); |
| 67 | } |