lkml.org 
[lkml]   [2003]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][ATM] make atm (and clip) modular + try_module_get()
Date
From
In message <20030303230706.R2791@almesberger.net>,Werner Almesberger writes:
>see getting moved to net/core/skbuff.c, because it seems to provide
>a reasonably generic function.

it has been suggested to me that the locking in skb_migrate might not be
completely correct. any comments on the following?

spinlock_t *first, *second;
if ((unsigned long)from < (unsigned long) to)) {
first = &from->lock;
second = &to->lock;
} else {
first = &to->lock;
second = &from->lock;
}

local_irq_save(flags);
spin_lock(&first);
spin_lock(&second);

i imagine this is to prevent deadlocks when you do something silly like
skb_migrate(a,b) and then skb_migrate(b,a) elsewhere.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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