From: Dipankar Sarma <dipankar@in.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>, linux-kernel@vger.kernel.org
Subject: Re: RCU callback and scheduling while atomic!
Date: Tue, 31 Aug 2004 21:51:40 +0530 [thread overview]
Message-ID: <20040831162140.GD3957@in.ibm.com> (raw)
In-Reply-To: <20040831161710.GA21782@MAIL.13thfloor.at>
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
next prev parent reply other threads:[~2004-08-31 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-31 16:17 RCU callback and scheduling while atomic! Herbert Poetzl
2004-08-31 16:21 ` Dipankar Sarma [this message]
2004-09-06 0:26 ` Herbert Poetzl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040831162140.GD3957@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox