All of lore.kernel.org
 help / color / mirror / Atom feed
* calling schedule() from interupt context
@ 2002-11-22  8:54 dan carpenter
  2002-11-22  9:09 ` David S. Miller
  2002-11-22  9:14 ` Robert Love
  0 siblings, 2 replies; 8+ messages in thread
From: dan carpenter @ 2002-11-22  8:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: rusty, torvalds, davem

I was running a script to find which functions call schedule() and I across something 
strange.  

In drivers/net/tokenring/3c359.c xl_interrupt() calls schedule().
The path from xl_interupt to schedule is:
xl_rx ==> netif_rx ==> 
kfree_skb ==> __kfree_skb ==> 
secpath_put ==> __secpath_destroy ==> 
xfrm_state_put ==> __xfrm_state_destroy ==> xfrm_put_type ==> 
module_put ==> put_cpu ==> preempt_schedule ==> schedule

The problem is that xl_interrupt is the interrupt handler for the 3c359 driver and
I did not think it was legal to call shedule() from interrupt context.

The second thing is that module_put() has a line that looks like it's decrementing
the module reference count (Is it supposed to do that?):
176                  local_dec(&module->ref[cpu].count);

The third thing I was wondering is:  xl_interupt is holding a 
spin_lock(&xl_priv->xl_lock).   I know that you're not supposed to call shedule()
while holding a spin lock, but is it ok to call preempt_schedule()?

thanks,
dan carpenter

-- 
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: calling schedule() from interupt context
@ 2002-11-22 16:04 dan carpenter
  2002-11-22 16:11 ` Robert Love
  0 siblings, 1 reply; 8+ messages in thread
From: dan carpenter @ 2002-11-22 16:04 UTC (permalink / raw)
  To: rml; +Cc: linux-kernel

From: Robert Love <rml@tech9.net>

> On Fri, 2002-11-22 at 03:54, dan carpenter wrote:
> 
> (Next time trim your CC list: none of those poor guys needed this
> email..)
> 

trimmed.

> > In drivers/net/tokenring/3c359.c xl_interrupt() calls schedule().
> > The path from xl_interupt to schedule is:
> > xl_rx ==> netif_rx ==> 
> > kfree_skb ==> __kfree_skb ==> 
> > secpath_put ==> __secpath_destroy ==> 
> > xfrm_state_put ==> __xfrm_state_destroy ==> xfrm_put_type ==> 
> > module_put ==> put_cpu ==> preempt_schedule ==> schedule
> 
> Are you actually seeing this code path or is this just what your script
> is showing you?
> 

ok.  I'm an idiot.

The script only checks things at compile time not at runtime.  So you are 
right, of course, that this couldn't happen in real life because of the
preemp_count.  

Thanks for the explanation...  

regards,
dan carpenter

-- 
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom


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

end of thread, other threads:[~2002-11-24 22:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-22  8:54 calling schedule() from interupt context dan carpenter
2002-11-22  9:09 ` David S. Miller
2002-11-22  9:16   ` Robert Love
2002-11-24 21:42   ` Rusty Russell
2002-11-24 22:41     ` Robert Love
2002-11-22  9:14 ` Robert Love
  -- strict thread matches above, loose matches on Subject: below --
2002-11-22 16:04 dan carpenter
2002-11-22 16:11 ` Robert Love

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.