On Mon, 7 Aug 2006, Henrik Nordstrom wrote:

> m??n 2006-08-07 klockan 17:50 +0800 skrev Steven:
> 
> > The attached patch is one solution.
> 
> Hmm. found the code not very obvious to follow here and your patch
> didn't exacly improve this..

After re-reading my message, I agree it wasn't too easy to follow :) 


> What do you think about having the call at the end of
> storeCheckCachable() just after the object is marked uncacheable, or
> perhaps better yet move that part of the logics up to storeSwapout
> making the conditions easier to follow.
> 
> I.e. something like the attached variant of the patch.

From what I can tell, the attached patch will break the current
behaviour.  storeCheckCachable() needs to remove the ENTRY_CACHABLE flag
so that other parts of the code know that they can free the memory.

Is the attached patch what you meant (free the memory as soon as we clear
the flag in storeCheckCachable()).

Steven
Index: src/store.c
===================================================================
RCS file: /server/cvs-server/squid/squid/src/store.c,v
retrieving revision 1.565
diff -u -r1.565 store.c
--- src/store.c 17 Jul 2006 02:32:00 -0000      1.565
+++ src/store.c 7 Aug 2006 11:33:44 -0000
@@ -1232,6 +1232,8 @@
     }
     storeReleaseRequest(e);
     EBIT_CLR(e->flags, ENTRY_CACHABLE);
+    /* Make sure we free any unneeded memory immediately */
+    storeSwapOutMaintainMemObject(e);
     return 0;
 }
 

Reply via email to