Patch for inode SLIST conversion
Simon 'corecode' Schubert
corecode at fs.ei.tum.de
Sat Jan 19 18:46:13 PST 2008
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
More information about the Kernel
mailing list