* is it useful testing __LINK_STATE_RX_SCHED in dev_close()?
@ 2007-11-21 1:40 wyb
2007-11-21 4:54 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: wyb @ 2007-11-21 1:40 UTC (permalink / raw)
To: netdev
cpu0 calling netif_rx_schedule_prep(), cpu1 calling dev_close():
cpu0: testing __LINK_STATE_START, already set
cpu1: clear__LINK_STATE_START
cpu1: testing __LINK_STATE_RX_SCHED, not set
cpu0: set __LINK_STATE_RX_SCHED
cpu0: enter net poll, ...
when cpu1 return from dev_close(),__LINK_STATE_RX_SCHED is still set, the
testing maybe of no use.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: is it useful testing __LINK_STATE_RX_SCHED in dev_close()?
2007-11-21 1:40 is it useful testing __LINK_STATE_RX_SCHED in dev_close()? wyb
@ 2007-11-21 4:54 ` Herbert Xu
2007-11-21 7:09 ` wyb
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2007-11-21 4:54 UTC (permalink / raw)
To: wyb; +Cc: netdev
wyb@topsec.com.cn wrote:
> cpu0 calling netif_rx_schedule_prep(), cpu1 calling dev_close():
>
> cpu0: testing __LINK_STATE_START, already set
> cpu1: clear__LINK_STATE_START
> cpu1: testing __LINK_STATE_RX_SCHED, not set
> cpu0: set __LINK_STATE_RX_SCHED
> cpu0: enter net poll, ...
>
> when cpu1 return from dev_close(),__LINK_STATE_RX_SCHED is still set, the
> testing maybe of no use.
Can you please check whether this still happens with the current
kernel since RX_SCHED no longer exists there?
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE:RE: is it useful testing __LINK_STATE_RX_SCHED in dev_close()?
2007-11-21 4:54 ` Herbert Xu
@ 2007-11-21 7:09 ` wyb
2007-11-21 8:54 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: wyb @ 2007-11-21 7:09 UTC (permalink / raw)
To: netdev; +Cc: 'Herbert Xu'
__LINK_STATE_RX_SCHED still exist in kernel 2.6.23.8.
Netdevice.h:
/* Test if receive needs to be scheduled */
static inline int __netif_rx_schedule_prep(struct net_device *dev)
{
return !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);
}
/* Test if receive needs to be scheduled but only if up */
static inline int netif_rx_schedule_prep(struct net_device *dev)
{
return netif_running(dev) && __netif_rx_schedule_prep(dev);
}
Dev.c:
int dev_close(struct net_device *dev)
{
...
while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
/* No hurry. */
msleep(1);
}
...
}
Test_bit() in dev_close() maybe between the calling of netif_running() and
__netif_rx_schedule_prep() in netif_rx_schedule_prep.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RE: is it useful testing __LINK_STATE_RX_SCHED in dev_close()?
2007-11-21 7:09 ` wyb
@ 2007-11-21 8:54 ` Herbert Xu
0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2007-11-21 8:54 UTC (permalink / raw)
To: wyb; +Cc: netdev
On Wed, Nov 21, 2007 at 03:09:52PM +0800, wyb@topsec.com.cn wrote:
>
> __LINK_STATE_RX_SCHED still exist in kernel 2.6.23.8.
You'll find that it's gone in 2.6.24-rc3. In any case, the code
was racy but it's too unlikely (and the fix too intrusive) to be
worth fixing in 2.6.23 at this stage.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-21 8:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-21 1:40 is it useful testing __LINK_STATE_RX_SCHED in dev_close()? wyb
2007-11-21 4:54 ` Herbert Xu
2007-11-21 7:09 ` wyb
2007-11-21 8:54 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).