Project

General

Profile

Actions

Bug #955

closed

lwkt_token_is_stale patch

Added by mneumann almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi,

Now that the release is over, is there any chance that the following
patch gets commited?

http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00015.html

Any feedback is welcome!

And the possible race for UP I describe in the mail:

http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00013.html

Do you think this can happen?

Regards,

Michael
Actions #1

Updated by dillon almost 14 years ago

:Hi,
:
:Now that the release is over, is there any chance that the following
:patch gets commited?
:
: http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00015.html

Absolutely.  I'll check it out right now.

:Any feedback is welcome!
:
:And the possible race for UP I describe in the mail:
:
: http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00013.html
:
:Do you think this can happen?
:
:Regards,
:
: Michael

Hmm.  Yes, if the compiler breaks the operation down into multiple
instructions the decrement could get lost. The compiler will virtually
never do that, but the only way for us to guarantee that it doesn't
(that is, to guarantee that the decrement is performed with a
single instruction) is to call the atomic_subtract_int_nonlocked()
inline.
I will make that change.
-Matt
Matthew Dillon
<>
Actions #2

Updated by dillon almost 14 years ago

:: http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00015.html
:
: Absolutely. I'll check it out right now.
:..
:...
: Hmm. Yes, if the compiler breaks the operation down into multiple
: instructions the decrement could get lost. The compiler will virtually
: never do that, but the only way for us to guarantee that it doesn't
: (that is, to guarantee that the decrement is performed with a
: single instruction) is to call the atomic_subtract_int_nonlocked()
: inline.
:
: I will make that change.

Ok, turns out you fixed the UP race issue in your patch already, by
decrementing t_count prior to removing the token from the list. Cool.
I fleshed out some of the comments in the patch but otherwise it looks
like it will be able to go in without any more adjustments to the code.
It looks very good. I'm running some tests now and will commit it
today.
Once we get it in we can check the code base for places where using
the new lwkt_token_is_stale() call would be beneficial, but even if
there aren't any obvious locations as yet the changes definitely
revitalize the token code and I'll bet we will be able to use it in
more places.
-Matt
Matthew Dillon
<>
Actions

Also available in: Atom PDF