... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Tue Jan 17 11:15:57 CET 2012 (acab) |
|
2 |
+----------------------------------- |
|
3 |
+ * misc: performance improvement for HP-UX PA-RISC - patch from |
|
4 |
+ Michael Pelletier <michael.v.pelletier*raytheon.com> (bb#3926) |
|
5 |
+ |
|
1 | 6 |
Fri Nov 4 00:52:21 CET 2011 (acab) |
2 | 7 |
----------------------------------- |
3 | 8 |
* libclamav/pe.c: parse vinfo where varfileinfo occours before stringfileinfo |
... | ... |
@@ -35,6 +35,7 @@ |
35 | 35 |
#include "others.h" |
36 | 36 |
#include "mpool.h" |
37 | 37 |
#include "server.h" |
38 |
+#include "libclamav/others.h" |
|
38 | 39 |
|
39 | 40 |
#ifdef HAVE_MALLINFO |
40 | 41 |
#include <malloc.h> |
... | ... |
@@ -467,7 +468,15 @@ threadpool_t *thrmgr_new(int max_threads, int idle_timeout, int max_queue, void |
467 | 467 |
#if defined(C_BIGSTACK) |
468 | 468 |
pthread_attr_getstacksize(&(threadpool->pool_attr), &stacksize); |
469 | 469 |
stacksize = stacksize + 64 * 1024; |
470 |
- if (stacksize < 1048576) stacksize = 1048576; /* at least 1MB please */ |
|
470 |
+ if (stacksize < 1048576) /* at least 1MB please */ |
|
471 |
+#if defined(C_HPUX) && defined(USE_MPOOL) |
|
472 |
+ /* Set aside one cli_pagesize() for the stack's pthread header, |
|
473 |
+ * giving a 1M region to fit a 1M large-page */ |
|
474 |
+ if(cli_getpagesize() < 1048576) |
|
475 |
+ stacksize = 1048576 - cli_getpagesize(); |
|
476 |
+ else |
|
477 |
+#endif |
|
478 |
+ stacksize = 1048576; |
|
471 | 479 |
logg("Set stacksize to %lu\n", (unsigned long int) stacksize); |
472 | 480 |
pthread_attr_setstacksize(&(threadpool->pool_attr), stacksize); |
473 | 481 |
#endif |
... | ... |
@@ -64,7 +64,11 @@ static inline void spam(const char *fmt, ...) { fmt = fmt; } /* gcc STFU */ |
64 | 64 |
|
65 | 65 |
#undef CL_DEBUG /* bb#2222 */ |
66 | 66 |
|
67 |
+#ifdef C_HPUX |
|
68 |
+#define MIN_FRAGSIZE 1048576 /* Goes with LDFLAGS=-Wl,+pd,1M */ |
|
69 |
+#else |
|
67 | 70 |
#define MIN_FRAGSIZE 262144 |
71 |
+#endif |
|
68 | 72 |
|
69 | 73 |
#if SIZEOF_VOID_P==8 |
70 | 74 |
static const unsigned int fragsz[] = { |