--------------------- PatchSet 5363 Date: 2007/08/17 04:22:17 Author: amosjeffries Branch: docs Tag: (none) Log: Move some MemPools docs from Misc. Members: doc/Programming-Guide/27_MiscOther.dox:1.1.2.2->1.1.2.3 include/MemPool.h:1.10.10.2->1.10.10.3 src/Mem.h:1.5->1.5.14.1 src/MemObject.h:1.14.4.2->1.14.4.3 Index: squid3/doc/Programming-Guide/27_MiscOther.dox =================================================================== RCS file: /cvsroot/squid-sf//squid3/doc/Programming-Guide/Attic/27_MiscOther.dox,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/doc/Programming-Guide/27_MiscOther.dox 11 Jul 2007 23:35:00 -0000 1.1.2.2 +++ squid3/doc/Programming-Guide/27_MiscOther.dox 17 Aug 2007 04:22:17 -0000 1.1.2.3 @@ -453,37 +453,4 @@ }; \endcode -\subsubsection memPoolClean memPoolClean -\code - memPoolClean(time_t maxage); -\endcode - -\par - Main cleanup handler. For MemPools to stay within upper idle limits, - this function needs to be called periodically, preferrably at some - constant rate, eg. from Squid event. It looks through all pools and - chunks, cleans up internal states and checks for releasable chunks. - -\par - Between the calls to this function objects are placed onto internal - cache instead of returning to their home chunks, mainly for speedup - purpose. During that time state of chunk is not known, it is not - known whether chunk is free or in use. This call returns all objects - to their chunks and restores consistency. - -\par - Should be called relatively often, as it sorts chunks in suitable - order as to reduce free memory fragmentation and increase chunk - utilisation. - -\par - Parameter maxage instructs to release all totally idle chunks that - have not been referenced for maxage seconds. - -\par - Suitable frequency for cleanup is in range of few tens of seconds to - few minutes, depending of memory activity. - Several functions above call memPoolClean internally to operate on - consistent states. - */ Index: squid3/include/MemPool.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/MemPool.h,v retrieving revision 1.10.10.2 retrieving revision 1.10.10.3 diff -u -r1.10.10.2 -r1.10.10.3 --- squid3/include/MemPool.h 15 Aug 2007 02:32:57 -0000 1.10.10.2 +++ squid3/include/MemPool.h 17 Aug 2007 04:22:17 -0000 1.10.10.3 @@ -86,7 +86,35 @@ MemImplementingAllocator * create(const char *label, size_t obj_size, bool const chunked); void setIdleLimit(size_t new_idle_limit); size_t const idleLimit() const; + + /** + \par + * Main cleanup handler. For MemPools to stay within upper idle limits, + * this function needs to be called periodically, preferrably at some + * constant rate, eg. from Squid event. It looks through all pools and + * chunks, cleans up internal states and checks for releasable chunks. + * + \par + * Between the calls to this function objects are placed onto internal + * cache instead of returning to their home chunks, mainly for speedup + * purpose. During that time state of chunk is not known, it is not + * known whether chunk is free or in use. This call returns all objects + * to their chunks and restores consistency. + * + \par + * Should be called relatively often, as it sorts chunks in suitable + * order as to reduce free memory fragmentation and increase chunk + * utilisation. + * Suitable frequency for cleanup is in range of few tens of seconds to + * few minutes, depending of memory activity. + * + \todo DOCS: Re-write this shorter! + * + \param maxage Release all totally idle chunks that + * have not been referenced for maxage seconds. + */ void clean(time_t maxage); + void setDefaultPoolChunking(bool const &); MemImplementingAllocator *pools; int mem_idle_limit; Index: squid3/src/Mem.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Mem.h,v retrieving revision 1.5 retrieving revision 1.5.14.1 diff -u -r1.5 -r1.5.14.1 --- squid3/src/Mem.h 29 May 2006 00:50:18 -0000 1.5 +++ squid3/src/Mem.h 17 Aug 2007 04:22:17 -0000 1.5.14.1 @@ -1,6 +1,5 @@ - /* - * $Id: Mem.h,v 1.5 2006/05/29 00:50:18 squidadm Exp $ + * $Id: Mem.h,v 1.5.14.1 2007/08/17 04:22:17 amosjeffries Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived Index: squid3/src/MemObject.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/MemObject.h,v retrieving revision 1.14.4.2 retrieving revision 1.14.4.3 diff -u -r1.14.4.2 -r1.14.4.3 --- squid3/src/MemObject.h 15 Aug 2007 02:48:04 -0000 1.14.4.2 +++ squid3/src/MemObject.h 17 Aug 2007 04:22:17 -0000 1.14.4.3 @@ -1,6 +1,5 @@ - /* - * $Id: MemObject.h,v 1.14.4.2 2007/08/15 02:48:04 amosjeffries Exp $ + * $Id: MemObject.h,v 1.14.4.3 2007/08/17 04:22:17 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -95,7 +94,8 @@ mem_hdr data_hdr; int64_t inmem_lo; dlink_list clients; - /* TODO: move into .cc or .cci */ + + /** \todo move into .cc or .cci */ size_t clientCount() const {return nclients;} bool clientIsFirst(void *sc) const {return (clients.head && sc == clients.head->data);} @@ -112,6 +112,7 @@ }; SwapOut swapout; + /* Read only - this reply must be preserved by store clients */ /* The original reply. possibly with updated metadata. */ HttpRequest *request; @@ -150,7 +151,7 @@ MEMPROXY_CLASS_INLINE(MemObject) /**DOCS_NOSEMI*/ -/* global current memory removal policy */ +/** global current memory removal policy */ extern RemovalPolicy *mem_policy; #endif /* SQUID_MEMOBJECT_H */