From: La M. H.P. Y. <pi...@em...> - 2002-05-03 16:14:10
|
Comments below inline. Jon Grimm writes: > > La Monte Henry Piggy Yarroll wrote: > > > Jon Grimm <jg...@au...> writes: > > > >>La Monte H.P. Yarroll wrote: > >> > >>>Yeah, new state. The EMPTY state is there for an association cache. > >>>If we decide that kalloc()ing them all the time is too expensive, we > >>>can keep a few around pre-allocated. > >>> > > > > I might add that EMPTY has the value 0 so that it gets set > > automagically with the appropriate memset(). > > > > > >>Hi La Monte, > >> > >>The fixed size object cache is a good idea and we could create our own > >>slab cache around for association structs. How did you think of > >>hooking this in? > >> > > > > It is just a matter of altering association_new() and association_free(), > > no? I can't claim credit for this, as I stole it from Randy, but the > > Linux kernel is full of similar examples. I would point out that this > > is an optimization issue and thus not of immediate interest. > > I think my question was _much_ too ambiguous. I know where we would > hook it in for allocation, I'm trying to figure the correlation to the > STATE_EMPTY and why you need the STATE_EMPTY to do this? I think I'm > missing the big picture on how you expected to use this. Oh, sorry. SCTP_STATE_EMPTY is for unused association objects which are in the cache. Mostly it is a bug catcher. You COULD implement the cache by creating a simple array of association structures, in which case you need to be able to mark available cache entries. Now that I think about it, association_free() should mark the association as SCTP_STATE_EMPTY before calling kfree(). This should catch cases of premature frees. > Its no big deal, as its not an immediate concern, but when you get the > chance clue me in on this. > > Thanks, > jon > > > > > >>Color me intrigued, > >>Jon |