You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2003/11/20 20:44:19 UTC
cvs commit: httpd-2.0/server/mpm/winnt child.c mpm.h
stoddard 2003/11/20 11:44:19
Modified: . CHANGES
server/mpm/winnt child.c mpm.h
Log:
Win32: Make Win32 MPM transaction pools honor MaxMemFree
Revision Changes Path
1.1317 +2 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1316
retrieving revision 1.1317
diff -u -r1.1316 -r1.1317
--- CHANGES 20 Nov 2003 03:45:22 -0000 1.1316
+++ CHANGES 20 Nov 2003 19:44:18 -0000 1.1317
@@ -1,6 +1,8 @@
Changes with Apache 2.1.0-dev
[Remove entries to the current 2.0 section below, when backported]
+ *) Win32 MPM: The bucket brigades subsystem now honors the MaxMemFree setting.
+ [Bill Stoddard]
*) mod_autoindex: new directive IndexStyleSheet
[Tyler Riddle <triddle_1999 yahoo.com>, Paul Querna <chip force-elite.com>]
1.17 +14 -4 httpd-2.0/server/mpm/winnt/child.c
Index: child.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/child.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- child.c 16 Nov 2003 01:51:28 -0000 1.16
+++ child.c 20 Nov 2003 19:44:18 -0000 1.17
@@ -185,6 +185,8 @@
* Multiple failures in the next two steps will cause the pchild pool
* to 'leak' storage. I don't think this is worth fixing...
*/
+ apr_allocator_t *allocator;
+
context = (PCOMP_CONTEXT) apr_pcalloc(pchild, sizeof(COMP_CONTEXT));
context->Overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -196,13 +198,17 @@
}
/* Create the tranaction pool */
- if ((rv = apr_pool_create(&context->ptrans, pchild)) != APR_SUCCESS) {
+ apr_allocator_create(&allocator);
+ apr_allocator_max_free_set(allocator, ap_max_mem_free);
+ rv = apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
+ if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK,APLOG_WARNING, rv, ap_server_conf,
"mpm_get_completion_context: Failed to create the transaction pool.");
CloseHandle(context->Overlapped.hEvent);
return NULL;
}
- apr_pool_tag(context->ptrans, "ptrans");
+ apr_allocator_owner_set(allocator, context->ptrans);
+ apr_pool_tag(context->ptrans, "transaction");
context->accept_socket = INVALID_SOCKET;
context->ba = apr_bucket_alloc_create(pchild);
@@ -437,9 +443,13 @@
if (context == NULL) {
/* allocate the completion context and the transaction pool */
+ apr_allocator_t *allocator;
context = apr_pcalloc(pchild, sizeof(COMP_CONTEXT));
- apr_pool_create(&context->ptrans, pchild);
- apr_pool_tag(context->ptrans, "ptrans");
+ apr_allocator_create(&allocator);
+ apr_allocator_max_free_set(allocator, ap_max_mem_free);
+ apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
+ apr_allocator_owner_set(allocator, context->ptrans);
+ apr_pool_tag(context->ptrans, "transaction");
context->ba = apr_bucket_alloc_create(pchild);
}
1.14 +1 -0 httpd-2.0/server/mpm/winnt/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- mpm.h 3 Feb 2003 17:53:25 -0000 1.13
+++ mpm.h 20 Nov 2003 19:44:18 -0000 1.14
@@ -72,6 +72,7 @@
#define AP_MPM_WANT_SET_MAX_REQUESTS
#define AP_MPM_WANT_SET_COREDUMPDIR
#define AP_MPM_WANT_SET_SCOREBOARD
+#define AP_MPM_WANT_SET_MAX_MEM_FREE
extern int ap_threads_per_child;
extern int ap_thread_limit;
Re: cvs commit: httpd-2.0/server/mpm/winnt child.c mpm.h
Posted by Cliff Woolley <jw...@virginia.edu>.
On Wed, 3 Dec 2003, Bill Stoddard wrote:
> Good intentions and all I was going to look into that. This was a
> straight port from worker.
Really? Humph. Guess we should look into that, yeah. :-)
Re: cvs commit: httpd-2.0/server/mpm/winnt child.c mpm.h
Posted by Bill Stoddard <bi...@wstoddard.com>.
Cliff Woolley wrote:
> On Thu, 20 Nov 2003 stoddard@apache.org wrote:
>
>
>>stoddard 2003/11/20 11:44:19
>>
>> Modified: . CHANGES
>> server/mpm/winnt child.c mpm.h
>> Log:
>> Win32: Make Win32 MPM transaction pools honor MaxMemFree
>>
>> /* Create the tranaction pool */
>> - if ((rv = apr_pool_create(&context->ptrans, pchild)) != APR_SUCCESS) {
>> + apr_allocator_create(&allocator);
>> + apr_allocator_max_free_set(allocator, ap_max_mem_free);
>> + rv = apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
>> + if (rv != APR_SUCCESS) {
>> ap_log_error(APLOG_MARK,APLOG_WARNING, rv, ap_server_conf,
>> "mpm_get_completion_context: Failed to create the transaction pool.");
>> CloseHandle(context->Overlapped.hEvent);
>> return NULL;
>> }
>> - apr_pool_tag(context->ptrans, "ptrans");
>> + apr_allocator_owner_set(allocator, context->ptrans);
>> + apr_pool_tag(context->ptrans, "transaction");
>
>
> This seems reasonable. +1 (untested). One question, though. Why is
> ptrans no longer a child pool of pchild?
>
> --Cliff
>
Good intentions and all I was going to look into that. This was a straight port from worker.
Bill
Re: cvs commit: httpd-2.0/server/mpm/winnt child.c mpm.h
Posted by Cliff Woolley <jw...@virginia.edu>.
On Thu, 20 Nov 2003 stoddard@apache.org wrote:
> stoddard 2003/11/20 11:44:19
>
> Modified: . CHANGES
> server/mpm/winnt child.c mpm.h
> Log:
> Win32: Make Win32 MPM transaction pools honor MaxMemFree
>
> /* Create the tranaction pool */
> - if ((rv = apr_pool_create(&context->ptrans, pchild)) != APR_SUCCESS) {
> + apr_allocator_create(&allocator);
> + apr_allocator_max_free_set(allocator, ap_max_mem_free);
> + rv = apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
> + if (rv != APR_SUCCESS) {
> ap_log_error(APLOG_MARK,APLOG_WARNING, rv, ap_server_conf,
> "mpm_get_completion_context: Failed to create the transaction pool.");
> CloseHandle(context->Overlapped.hEvent);
> return NULL;
> }
> - apr_pool_tag(context->ptrans, "ptrans");
> + apr_allocator_owner_set(allocator, context->ptrans);
> + apr_pool_tag(context->ptrans, "transaction");
This seems reasonable. +1 (untested). One question, though. Why is
ptrans no longer a child pool of pchild?
--Cliff
Re: cvs commit: httpd-2.0/server/mpm/winnt child.c mpm.h
Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 20 Nov 2003 stoddard@apache.org wrote:
> stoddard 2003/11/20 11:44:19
>
> Modified: . CHANGES
> server/mpm/winnt child.c mpm.h
> Log:
> Win32: Make Win32 MPM transaction pools honor MaxMemFree
There's a very small doc change needed here too. (Just add
mpm_winnt to the <modulelist> for that directive.)
Joshua.