netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question on pktgen shutdown logic.
@ 2013-05-22 23:15 Ben Greear
  2013-05-22 23:22 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Greear @ 2013-05-22 23:15 UTC (permalink / raw)
  To: netdev

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 <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-22 23:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 23:15 question on pktgen shutdown logic Ben Greear
2013-05-22 23:22 ` Eric Dumazet
2013-05-22 23:28   ` Ben Greear
2013-05-22 23:35     ` Eric Dumazet
2013-05-22 23:52       ` Ben Greear

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).