* RCU callback and scheduling while atomic!
@ 2004-08-31 16:17 Herbert Poetzl
2004-08-31 16:21 ` Dipankar Sarma
0 siblings, 1 reply; 3+ messages in thread
From: Herbert Poetzl @ 2004-08-31 16:17 UTC (permalink / raw)
To: Dipankar Sarma, Rusty Russell; +Cc: linux-kernel
Hi Dipankar!
Hi Rusty!
just a short question regarding RCU callbacks:
it seems that the RCU callback is not allowed
to (re-)schedule, as it is done occasionally by
put_namespace() for example, as I keep getting
"bad: scheduling while atomic!", when I do so ...
now the question: what is the 'correct' way to
drop a reference to a namespace when freeing up
a structure from an RCU callback?
TIA,
Herbert
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RCU callback and scheduling while atomic!
2004-08-31 16:17 RCU callback and scheduling while atomic! Herbert Poetzl
@ 2004-08-31 16:21 ` Dipankar Sarma
2004-09-06 0:26 ` Herbert Poetzl
0 siblings, 1 reply; 3+ messages in thread
From: Dipankar Sarma @ 2004-08-31 16:21 UTC (permalink / raw)
To: Rusty Russell, linux-kernel
On Tue, Aug 31, 2004 at 06:17:10PM +0200, Herbert Poetzl wrote:
>
> it seems that the RCU callback is not allowed
> to (re-)schedule, as it is done occasionally by
> put_namespace() for example, as I keep getting
> "bad: scheduling while atomic!", when I do so ...
>
> now the question: what is the 'correct' way to
> drop a reference to a namespace when freeing up
> a structure from an RCU callback?
You are right about not allowing schedule from callbacks. The callbacks
are called from softirq context.
Without your current code, it is difficult to say how to do this but here are
some guesses -
1. You could mark the freed up structure deleted on update, do
put_namspace() and do only the freeing in the rcu callback.
dentries do this.
2. If not performance critical, you could use a workqueue to
do the actual freeing including put_namespace(). Just wake up
from the rcu callback.
These may or may not be applicable to your case. More details will
help.
Thanks
Dipankar
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RCU callback and scheduling while atomic!
2004-08-31 16:21 ` Dipankar Sarma
@ 2004-09-06 0:26 ` Herbert Poetzl
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Poetzl @ 2004-09-06 0:26 UTC (permalink / raw)
To: Dipankar Sarma; +Cc: Rusty Russell, linux-kernel
On Tue, Aug 31, 2004 at 09:51:40PM +0530, Dipankar Sarma wrote:
> On Tue, Aug 31, 2004 at 06:17:10PM +0200, Herbert Poetzl wrote:
> >
> > it seems that the RCU callback is not allowed
> > to (re-)schedule, as it is done occasionally by
> > put_namespace() for example, as I keep getting
> > "bad: scheduling while atomic!", when I do so ...
> >
> > now the question: what is the 'correct' way to
> > drop a reference to a namespace when freeing up
> > a structure from an RCU callback?
>
> You are right about not allowing schedule from callbacks. The callbacks
> are called from softirq context.
>
> Without your current code, it is difficult to say how to do this but here are
> some guesses -
>
> 1. You could mark the freed up structure deleted on update, do
> put_namspace() and do only the freeing in the rcu callback.
> dentries do this.
>
> 2. If not performance critical, you could use a workqueue to
> do the actual freeing including put_namespace(). Just wake up
> from the rcu callback.
ah, okay, I see, although it isn't time critical,
it seems to me that the first is the best choice
in my case, thanks for the hints ...
> These may or may not be applicable to your case. More details will
> help.
thanks,
Herbert
> Thanks
> Dipankar
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-06 0:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 16:17 RCU callback and scheduling while atomic! Herbert Poetzl
2004-08-31 16:21 ` Dipankar Sarma
2004-09-06 0:26 ` Herbert Poetzl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox