[ 
https://issues.apache.org/jira/browse/TS-3417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14359584#comment-14359584
 ] 

Leif Hedstrom commented on TS-3417:
-----------------------------------

If we ever want to enable this option again, seems unlikely, but just in case, 
the following patch would have fixed the build issues:

{code}
diff --git a/iocore/eventsystem/EventSystem.cc 
b/iocore/eventsystem/EventSystem.cc
index 4d61f39..d31061d 100644
--- a/iocore/eventsystem/EventSystem.cc
+++ b/iocore/eventsystem/EventSystem.cc
@@ -49,5 +49,16 @@ ink_event_system_init(ModuleVersion v)
     default_small_iobuffer_size = max_iobuffer_size;
   if (default_large_iobuffer_size > max_iobuffer_size)
     default_large_iobuffer_size = max_iobuffer_size;
+
+#ifdef MADV_DONTDUMP // This should only exist on Linux 3.4 and higher.
+    bool dont_dump_enabled;
+    RecGetRecordBool("proxy.config.allocator.dontdump_iobuffers", (RecBool 
*)&dont_dump_enabled, false);
+
+    if (dont_dump_enabled) {
+      iobuffer_advice = MADV_DONTDUMP;
+    }
+#endif
+
+
   init_buffer_allocators();
 }
diff --git a/iocore/eventsystem/IOBuffer.cc b/iocore/eventsystem/IOBuffer.cc
index 56abb20..3a6bfe7 100644
--- a/iocore/eventsystem/IOBuffer.cc
+++ b/iocore/eventsystem/IOBuffer.cc
@@ -39,6 +39,7 @@ inkcoreapi ClassAllocator<IOBufferBlock> 
ioBlockAllocator("ioBlockAllocator", DE
 int64_t default_large_iobuffer_size = DEFAULT_LARGE_BUFFER_SIZE;
 int64_t default_small_iobuffer_size = DEFAULT_SMALL_BUFFER_SIZE;
 int64_t max_iobuffer_size = DEFAULT_BUFFER_SIZES - 1;
+int iobuffer_advice = 0;

 //
 // Initialization
@@ -47,16 +48,6 @@ void
 init_buffer_allocators()
 {
   char *name;
-  int advice = 0;
-
-#ifdef MADV_DONTDUMP // This should only exist on Linux 3.4 and higher.
-    bool dont_dump_enabled;
-    RecGetRecordBool("proxy.config.allocator.dontdump_iobuffers", (RecBool 
*)&dont_dump_enabled, false);
-
-    if (dont_dump_enabled) {
-      advice = MADV_DONTDUMP;
-    }
-#endif

   for (int i = 0; i < DEFAULT_BUFFER_SIZES; i++) {
     int64_t s = DEFAULT_BUFFER_BASE_SIZE * (((int64_t)1) << i);
@@ -67,7 +58,7 @@ init_buffer_allocators()

     name = new char[64];
     snprintf(name, 64, "ioBufAllocator[%d]", i);
-    ioBufAllocator[i].re_init(name, s, n, a, advice);
+    ioBufAllocator[i].re_init(name, s, n, a, iobuffer_advice);
   }
 }

diff --git a/iocore/eventsystem/I_IOBuffer.h b/iocore/eventsystem/I_IOBuffer.h
index 0e5fe0c..a423754 100644
--- a/iocore/eventsystem/I_IOBuffer.h
+++ b/iocore/eventsystem/I_IOBuffer.h
@@ -54,6 +54,7 @@ class VIO;
 inkcoreapi extern int64_t max_iobuffer_size;
 extern int64_t default_small_iobuffer_size;
 extern int64_t default_large_iobuffer_size; // matched to size of OS buffers
+extern int iobuffer_advice;

 #if !defined(TRACK_BUFFER_USER)
 #define TRACK_BUFFER_USER 1
{code}


> Use madvise() with MADV_DONTDUMP option to limit core sizes
> -----------------------------------------------------------
>
>                 Key: TS-3417
>                 URL: https://issues.apache.org/jira/browse/TS-3417
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Phil Sorber
>            Assignee: Phil Sorber
>             Fix For: 5.3.0
>
>
> When ATS crashes it often leaves behind very large core files, in the 
> hundreds of gigabytes. A large percentage of these core files are useless 
> data in the IO buffers. We can limit the pages that the kernel dumps with 
> madvise().
> Note: This will only work on Linux 3.4+.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to