]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Win32: Implement MaxMemFree directive
authorBill Stoddard <stoddard@apache.org>
Thu, 11 Dec 2003 02:02:09 +0000 (02:02 +0000)
committerBill Stoddard <stoddard@apache.org>
Thu, 11 Dec 2003 02:02:09 +0000 (02:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102024 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/mod/mpm_common.xml
docs/manual/mod/mpm_winnt.xml
server/mpm/winnt/child.c
server/mpm/winnt/mpm.h

diff --git a/CHANGES b/CHANGES
index 44e04c4b692ccc423512453226c443c4540e8390..f829609e685e0a10042c24b597e1ddc46173c77e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 Changes with Apache 2.0.49
+  *) Win32 MPM: Implement MaxMemFree to enable setting an upper
+     limit on the amount of storage used by the bucket brigades
+     in each server thread. [Bill Stoddard]
 
   *) Modified the cache code to be header-location agnostic. Also
      fixed a number of other cache code bugs related to PR 15852.
diff --git a/STATUS b/STATUS
index 6a569d95e9910780de32bf1ef3f79aaa1a71e8d1..93915bcaf3cd5707f05294eb46dd920d547f3101 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2003/12/10 23:01:00 $]
+Last modified at [$Date: 2003/12/11 02:02:08 $]
 
 Release:
 
@@ -89,14 +89,6 @@ PATCHES TO BACKPORT FROM 2.1
       http://cvs.apache.org/viewcvs/httpd-2.0/server/mpm/prefork/prefork.c.diff?r1=1.279&r2=1.280
       +1: jorton, trawick
 
-    * Make Win32 MPM honor MaxMemFree for transaction pools
-      server/mpm/winnt/child.c: r1.17
-      server/mpm/winnt/mpm.h: r1.14
-      +1: stoddard
-      +1 (concept): trawick (looks reasonable when compared with worker)
-      +1 (concept): jwoolley (same reason.  though why is ptrans no longer
-                              a child pool of pchild?)
-
     * parsed_uri.port is only valid iff parsed_uri.port_str != NULL.
       Old code simply checked if it was non-zero, not if it
       was *valid*
@@ -345,7 +337,7 @@ PATCHES TO BACKPORT FROM 2.1
     * Fix a long delay with CGI requests and keepalive connections on
       AIX.
         modules/generators/mod_cgid.c r1.159
-      +1: trawick
+      +1: trawick, stoddard
 
     * mod_status hook
         configure.in r1.254
index 546f3e7ecf01420350106062aa76968300d923be..0fa3ee46ac7709bb97debf29d7af45ab395d9408 100644 (file)
@@ -387,7 +387,7 @@ to hold without calling <code>free()</code></description>
 <contextlist><context>server config</context></contextlist>
 <modulelist><module>beos</module><module>leader</module>
 <module>mpm_netware</module><module>prefork</module>
-<module>threadpool</module><module>worker</module></modulelist>
+<module>threadpool</module><module>worker</module><module>mpm_winnt</module></modulelist>
 
 <usage>
     <p>The <directive>MaxMemFree</directive> directive sets the
index 59a90233a64f1fd08bb7b442f1e7c3def940a17f..a42e7c34eba4e9831c200e9991b4ef8f07d9e10e 100644 (file)
@@ -27,6 +27,8 @@ NT.</description>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
 </directivesynopsis>
+<directivesynopsis location="mpm_common"><name>MaxMemFree</name>
+</directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
index d890db860db625d1a6a5e679747e571fe405b97b..91e987fb44651b33b3ddce74f583a00800b0cfd7 100644 (file)
@@ -185,6 +185,8 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void)
                  * 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,14 +198,17 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void)
                 }
  
                 /* 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, pchild, 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_pool_tag(context->ptrans, "transaction");
+                apr_allocator_owner_set(allocator, context->ptrans);
                 context->accept_socket = INVALID_SOCKET;
                 context->ba = apr_bucket_alloc_create(pchild);
                 apr_atomic_inc(&num_completion_contexts); 
@@ -437,9 +442,12 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context)
 
     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, pchild, NULL, allocator);
+        apr_pool_tag(context->ptrans, "transaction");
         context->ba = apr_bucket_alloc_create(pchild);
     }
     
index 0c0825a0cb688d7bcb40de8e8c6d45d268aa4ed8..08bcf91f7c3d296923ae2822596e9b3507e83773 100644 (file)
@@ -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;