trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject [trafficserver] branch master updated: MADV_DODUMP
Date Wed, 03 Jan 2018 16:10:46 GMT
This is an automated email from the ASF dual-hosted git repository.

shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 0281f33  MADV_DODUMP
0281f33 is described below

commit 0281f339400dee065dbb76b8c4cb05b6b99d6672
Author: Fei Deng <duke8253@gmail.com>
AuthorDate: Wed Dec 20 10:52:03 2017 -0600

    MADV_DODUMP
---
 lib/ts/ink_queue.cc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ts/ink_queue.cc b/lib/ts/ink_queue.cc
index b6606ec..4f48c24 100644
--- a/lib/ts/ink_queue.cc
+++ b/lib/ts/ink_queue.cc
@@ -320,6 +320,11 @@ static void
 malloc_free(InkFreeList *f, void *item)
 {
   if (f->alignment) {
+#ifdef MADV_DODUMP
+    if (f->advice && (INK_ALIGN((uint64_t)item, ats_pagesize()) == (uint64_t)item))
{
+      ats_madvise((caddr_t)item, INK_ALIGN(f->type_size, f->alignment), MADV_DODUMP);
+    }
+#endif
     ats_memalign_free(item);
   } else {
     ats_free(item);
@@ -389,6 +394,11 @@ malloc_bulkfree(InkFreeList *f, void *head, void *tail, size_t num_item)
   if (f->alignment) {
     for (size_t i = 0; i < num_item && item; ++i, item = next) {
       next = *(void **)item; // find next item before freeing current item
+#ifdef MADV_DODUMP
+      if (f->advice && (INK_ALIGN((uint64_t)item, ats_pagesize()) == (uint64_t)item))
{
+        ats_madvise((caddr_t)item, INK_ALIGN(f->type_size, f->alignment), MADV_DODUMP);
+      }
+#endif
       ats_memalign_free(item);
     }
   } else {

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message