You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2018/01/03 16:10:46 UTC
[trafficserver] branch master updated: MADV_DODUMP
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 <du...@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" <co...@trafficserver.apache.org>'].