All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>, linux-kernel@vger.kernel.org
Subject: Re: RCU callback and scheduling while atomic!
Date: Mon, 6 Sep 2004 02:26:01 +0200	[thread overview]
Message-ID: <20040906002601.GA19608@MAIL.13thfloor.at> (raw)
In-Reply-To: <20040831162140.GD3957@in.ibm.com>

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/

      reply	other threads:[~2004-09-06  0: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
2004-09-06  0:26   ` Herbert Poetzl [this message]

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=20040906002601.GA19608@MAIL.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=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 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.