DragonFly kernel List (threaded) for 2008-01
DragonFly BSD
DragonFly kernel List (threaded) for 2008-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Patch for inode SLIST conversion


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sun, 20 Jan 2008 03:41:16 +0100

Michael Neumann wrote:
>> This could be an efficient, but not generic solution.  I was thinking
>> of something like this:  Have a generation counter in the tokens.  If
>> you release a token and somebody else aquires it, the generation will
>> change.  Have a function lwkt_token_stale() to check whether the token
>> has been used by somebody else since the last check/aquire.  How does
>> that sound? This could be applied to different areas in the kernel
>> which use tokens.
> 
> You mean to add a generation field to lwkt_token plus a
> current_generation field to lwkt_tokref?

Yes.

> lwkt_token_stale(&lock, &token) would then simply check
> for ilock->current_generation == token->generation, and
> lwkt_gettoken() would increase the generation. Alternatively
> a special lwkt_token_inc() could be used to increase the generation.

Not only gettoken, but also the lwkt code that re-obtains tokens.  Doing
a manual _inc() defeats the idea.

> Don't know if the overhead is justified. Probably only if it's used
> that often.

Which overhead?  Incrementing an integer?

cheers
  simon



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]