[SVN-Commit] r1073 - in trunk: mail/thunderbird/files www/firefox-nightly/files www/firefox/files www/seamonkey/files
svn-freebsd-gecko at chruetertee.ch
svn-freebsd-gecko at chruetertee.ch
Fri Oct 19 03:19:44 UTC 2012
Author: jbeich
Date: Fri Oct 19 03:19:31 2012
New Revision: 1073
Log:
count dirty unused pages in heap-committed, too
Modified:
trunk/mail/thunderbird/files/patch-z-bug762445
trunk/www/firefox-nightly/files/patch-z-bug762445
trunk/www/firefox/files/patch-z-bug762445
trunk/www/seamonkey/files/patch-z-bug762445
Modified: trunk/mail/thunderbird/files/patch-z-bug762445
==============================================================================
--- trunk/mail/thunderbird/files/patch-z-bug762445 Sat Oct 13 00:08:01 2012 (r1072)
+++ trunk/mail/thunderbird/files/patch-z-bug762445 Fri Oct 19 03:19:31 2012 (r1073)
@@ -11,19 +11,25 @@
index 94ad96e..7adfef5 100644
--- mozilla/memory/build/mozjemalloc_compat.c
+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,37 @@
+@@ -11,15 +11,50 @@
#define wrap(a) je_ ## a
#endif
-extern MOZ_IMPORT_API(int)
++/*
++ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
++ * - drop `t' argument to avoid redundancy in calculating type size
++ * - require `i' argument for arena number explicitly
++ */
++
+#define CTL_GET(n, v) do { \
+ size_t sz = sizeof(v); \
+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
+} while (0)
+
-+#define CTL_I_GET(n, v) do { \
++#define CTL_I_GET(n, v, i) do { \
+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(size_t); \
++ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
+ size_t sz = sizeof(v); \
+ wrap(mallctlnametomib)(n, mib, &miblen); \
+ mib[2] = i; \
@@ -45,13 +51,20 @@
- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
-+ unsigned i;
-+ size_t page;
-+ CTL_GET("arenas.narenas", i);
++ unsigned narenas;
++ size_t active, allocated, mapped, page, pdirty;
++
++ CTL_GET("arenas.narenas", narenas);
+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", stats->committed);
-+ CTL_GET("stats.allocated", stats->allocated);
-+ CTL_GET("stats.mapped", stats->mapped);
-+ CTL_I_GET("stats.arenas.0.pdirty", stats->dirty);
-+ stats->dirty *= page;
++ CTL_GET("stats.active", active);
++ CTL_GET("stats.allocated", allocated);
++ CTL_GET("stats.mapped", mapped);
++
++ /* get the summation for all arenas, i == narenas */
++ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
++
++ stats->allocated = allocated;
++ stats->mapped = mapped;
++ stats->dirty = pdirty * page;
++ stats->committed = active + stats->dirty;
}
Modified: trunk/www/firefox-nightly/files/patch-z-bug762445
==============================================================================
--- trunk/www/firefox-nightly/files/patch-z-bug762445 Sat Oct 13 00:08:01 2012 (r1072)
+++ trunk/www/firefox-nightly/files/patch-z-bug762445 Fri Oct 19 03:19:31 2012 (r1073)
@@ -11,19 +11,25 @@
index 94ad96e..7adfef5 100644
--- memory/build/mozjemalloc_compat.c
+++ memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,37 @@
+@@ -11,15 +11,50 @@
#define wrap(a) je_ ## a
#endif
-extern MOZ_IMPORT_API(int)
++/*
++ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
++ * - drop `t' argument to avoid redundancy in calculating type size
++ * - require `i' argument for arena number explicitly
++ */
++
+#define CTL_GET(n, v) do { \
+ size_t sz = sizeof(v); \
+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
+} while (0)
+
-+#define CTL_I_GET(n, v) do { \
++#define CTL_I_GET(n, v, i) do { \
+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(size_t); \
++ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
+ size_t sz = sizeof(v); \
+ wrap(mallctlnametomib)(n, mib, &miblen); \
+ mib[2] = i; \
@@ -45,13 +51,20 @@
- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
-+ unsigned i;
-+ size_t page;
-+ CTL_GET("arenas.narenas", i);
++ unsigned narenas;
++ size_t active, allocated, mapped, page, pdirty;
++
++ CTL_GET("arenas.narenas", narenas);
+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", stats->committed);
-+ CTL_GET("stats.allocated", stats->allocated);
-+ CTL_GET("stats.mapped", stats->mapped);
-+ CTL_I_GET("stats.arenas.0.pdirty", stats->dirty);
-+ stats->dirty *= page;
++ CTL_GET("stats.active", active);
++ CTL_GET("stats.allocated", allocated);
++ CTL_GET("stats.mapped", mapped);
++
++ /* get the summation for all arenas, i == narenas */
++ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
++
++ stats->allocated = allocated;
++ stats->mapped = mapped;
++ stats->dirty = pdirty * page;
++ stats->committed = active + stats->dirty;
}
Modified: trunk/www/firefox/files/patch-z-bug762445
==============================================================================
--- trunk/www/firefox/files/patch-z-bug762445 Sat Oct 13 00:08:01 2012 (r1072)
+++ trunk/www/firefox/files/patch-z-bug762445 Fri Oct 19 03:19:31 2012 (r1073)
@@ -11,19 +11,25 @@
index 94ad96e..7adfef5 100644
--- memory/build/mozjemalloc_compat.c
+++ memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,37 @@
+@@ -11,15 +11,50 @@
#define wrap(a) je_ ## a
#endif
-extern MOZ_IMPORT_API(int)
++/*
++ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
++ * - drop `t' argument to avoid redundancy in calculating type size
++ * - require `i' argument for arena number explicitly
++ */
++
+#define CTL_GET(n, v) do { \
+ size_t sz = sizeof(v); \
+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
+} while (0)
+
-+#define CTL_I_GET(n, v) do { \
++#define CTL_I_GET(n, v, i) do { \
+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(size_t); \
++ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
+ size_t sz = sizeof(v); \
+ wrap(mallctlnametomib)(n, mib, &miblen); \
+ mib[2] = i; \
@@ -45,13 +51,20 @@
- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
-+ unsigned i;
-+ size_t page;
-+ CTL_GET("arenas.narenas", i);
++ unsigned narenas;
++ size_t active, allocated, mapped, page, pdirty;
++
++ CTL_GET("arenas.narenas", narenas);
+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", stats->committed);
-+ CTL_GET("stats.allocated", stats->allocated);
-+ CTL_GET("stats.mapped", stats->mapped);
-+ CTL_I_GET("stats.arenas.0.pdirty", stats->dirty);
-+ stats->dirty *= page;
++ CTL_GET("stats.active", active);
++ CTL_GET("stats.allocated", allocated);
++ CTL_GET("stats.mapped", mapped);
++
++ /* get the summation for all arenas, i == narenas */
++ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
++
++ stats->allocated = allocated;
++ stats->mapped = mapped;
++ stats->dirty = pdirty * page;
++ stats->committed = active + stats->dirty;
}
Modified: trunk/www/seamonkey/files/patch-z-bug762445
==============================================================================
--- trunk/www/seamonkey/files/patch-z-bug762445 Sat Oct 13 00:08:01 2012 (r1072)
+++ trunk/www/seamonkey/files/patch-z-bug762445 Fri Oct 19 03:19:31 2012 (r1073)
@@ -11,19 +11,25 @@
index 94ad96e..7adfef5 100644
--- mozilla/memory/build/mozjemalloc_compat.c
+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,37 @@
+@@ -11,15 +11,50 @@
#define wrap(a) je_ ## a
#endif
-extern MOZ_IMPORT_API(int)
++/*
++ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
++ * - drop `t' argument to avoid redundancy in calculating type size
++ * - require `i' argument for arena number explicitly
++ */
++
+#define CTL_GET(n, v) do { \
+ size_t sz = sizeof(v); \
+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
+} while (0)
+
-+#define CTL_I_GET(n, v) do { \
++#define CTL_I_GET(n, v, i) do { \
+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(size_t); \
++ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
+ size_t sz = sizeof(v); \
+ wrap(mallctlnametomib)(n, mib, &miblen); \
+ mib[2] = i; \
@@ -45,13 +51,20 @@
- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
-+ unsigned i;
-+ size_t page;
-+ CTL_GET("arenas.narenas", i);
++ unsigned narenas;
++ size_t active, allocated, mapped, page, pdirty;
++
++ CTL_GET("arenas.narenas", narenas);
+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", stats->committed);
-+ CTL_GET("stats.allocated", stats->allocated);
-+ CTL_GET("stats.mapped", stats->mapped);
-+ CTL_I_GET("stats.arenas.0.pdirty", stats->dirty);
-+ stats->dirty *= page;
++ CTL_GET("stats.active", active);
++ CTL_GET("stats.allocated", allocated);
++ CTL_GET("stats.mapped", mapped);
++
++ /* get the summation for all arenas, i == narenas */
++ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
++
++ stats->allocated = allocated;
++ stats->mapped = mapped;
++ stats->dirty = pdirty * page;
++ stats->committed = active + stats->dirty;
}
More information about the freebsd-gecko
mailing list