lkml.org 
[lkml]   [1999]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] shaper fix for timer SMP races
Andrea Arcangeli <andrea@e-mind.com> wrote:
>I developed a new patch that I sent to Alex now for testing.
> --- shaper.c 1999/01/18 01:28:09 1.1.1.1
> +++ linux/drivers/net/shaper.c 1999/02/16 13:25:36
> [...]
> @@ -405,7 +394,9 @@
> {
> struct shaper *shaper=dev->priv;
> shaper_flush(shaper);
> + start_bh_atomic();
> del_timer(&shaper->timer);
> + end_bh_atomic();
> MOD_DEC_USE_COUNT;
> return 0;
> }

Isn't that part of the patch overkill?

As I understand things, del_timer() must acquire the timerlist_lock
spinlock to modify the timer list. I guess that all other code
(including the code in bottom half handlers) that want to modify the
timer list do the same.

So why do we need to use [start|end]_bh_atomic() to guarantee that no
BH on any CPU will execute while we modify the timer list?

Best regards,
--
Regis "HPReg" Duchesne - InfoVista US technical support
www http://www.InfoVista.com/
(O o) I use Linux (1135 KB/s over 10Mb/s ethernet)
--.oOO--(_)--OOo.----------------------------------------------------
If cryptography is outlawed, only outlaws will have cryptography


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.029 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site