Subject: question on pktgen shutdown logic.

From: Ben Greear <[email-masked]>
Date: Wed, 22 May 2013 16:15:39 -0700

While looking at pktgen.c in 3.9.3, I cannot explain how
it does not race on shutdown.

The thread worker checks for pktgen_exiting, and will bail out
of it's main loop and initiate cleanup if this is true.

The pg_net_exit sets the pktgen_exiting to true, and then
proceedes to call

		kthread_stop(t->tsk);
		kfree(t);

What I don't understand is what keeps the kfree(t) from happening
before the thread has noticed pktgen_exiting is set and properly
bailed out of it's loop and finished cleanup?

Thanks,
Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com