Re: [PATCH] kill 8139too kernel thread (sorta)

From: Herbert Xu
Date: Fri Nov 04 2005 - 23:20:20 EST


On Fri, Nov 04, 2005 at 10:47:19PM -0500, Jeff Garzik wrote:
> Here's a better version, that uses cancel_rearming_...

Yep it certainly solves the race condition.

> + if (rtnl_shlock_nowait() == 0) {
> rtl8139_thread_iter (dev, tp, tp->mmio_addr);
> rtnl_unlock ();
> }
>
> - complete_and_exit (&tp->thr_exited, 0);
> + schedule_delayed_work(&tp->thread, next_tick);

My only concern is the potential for starvation here should we fail
to obtain the RTNL. Since any local user can hold the RTNL by issuing
rtnetlink requests, it is theoretically possible for the rtl8139 work
to be delayed indefinitely.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/