From: Dipankar Sarma <dipankar@gamebox.net>
To: Corey Minyard <cminyard@mvista.com>
Cc: linux-kernel@vger.kernel.org, John Levon <levon@movementarian.org>
Subject: Re: [PATCH] NMI request/release, version 4
Date: Thu, 24 Oct 2002 13:11:03 +0530 [thread overview]
Message-ID: <20021024131103.E27739@dikhow> (raw)
In-Reply-To: <3DB71A5E.5010907@mvista.com>; from cminyard@mvista.com on Wed, Oct 23, 2002 at 04:53:34PM -0500
On Wed, Oct 23, 2002 at 04:53:34PM -0500, Corey Minyard wrote:
> >After local_irq_count() went away, the idle CPU check was broken
> >and that meant that if you had an idle CPU, it could hold up RCU
> >grace period completion.
> >
> Ah, much better. That seems to fix it.
Great! Do you have any latency numbers ? Just curious.
>
> >It might just be simpler to use completions instead -
> >
> > call_rcu(&(handler->rcu), free_nmi_handler, handler);
> > init_completion(&handler->completion);
> > spin_unlock_irqrestore(&nmi_handler_lock, flags);
> > wait_for_completion(&handler->completion);
> >
> >and do
> >
> > complete(&handler->completion);
> >
> >in the the RCU callback.
> >
> I was working under the assumption that the spinlocks were needed. But
> now I see that there are spinlocks in wait_for_completion. You did get
> init_completion() and call_rcu() backwards, they would need to be the
> opposite order, I think.
AFAICS, the ordering of call_rcu() and init_completion should not matter
because the CPU that is executing them would not have gone
through a quiescent state and thus the RCU callback cannot happen.
Only after a context swtich in wait_for_completion(), the callback
is possible.
>
> >Also, now I think your original idea of "Don't do this!" :) was right.
> >Waiting until an nmi handler is seen unlinked could make a task
> >block for a long time if another task re-installs it. You should
> >probably just fail installation of a busy handler (checked under
> >lock).
> >
> Since just about all of these will be in modules at unload time, I'm
> thinking that the way it is now is better. Otherwise, someone will mess
> it up. IMHO, it's much more likely that someone doesn't handle the
> callback correctly than someone reused the value before the call that
> releases it returns. I'd prefer to leave it the way it is now.
Oh, I didn't mean the part about waiting in release_nmi() until
the release is complete (RCU callback done). That is absolutely
necessary. I was talking about looping until the handler is
not busy any more. I think it is safe to just do a wait_for_completion()
and return in release_nmi().
Thanks
Dipankar
next prev parent reply other threads:[~2002-10-24 7:40 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-22 1:32 [PATCH] NMI request/release Corey Minyard
2002-10-22 2:10 ` John Levon
2002-10-22 2:32 ` Corey Minyard
2002-10-22 2:53 ` John Levon
2002-10-22 13:02 ` Corey Minyard
2002-10-22 15:09 ` John Levon
2002-10-22 16:03 ` Corey Minyard
2002-10-22 17:23 ` Robert Love
2002-10-22 18:08 ` Corey Minyard
2002-10-22 18:16 ` Robert Love
2002-10-22 20:04 ` Dipankar Sarma
2002-10-22 17:53 ` Dipankar Sarma
2002-10-22 18:05 ` Corey Minyard
2002-10-22 18:08 ` Dipankar Sarma
2002-10-22 18:29 ` Corey Minyard
2002-10-22 19:08 ` John Levon
2002-10-22 21:36 ` [PATCH] NMI request/release, version 3 Corey Minyard
2002-10-23 17:33 ` Dipankar Sarma
2002-10-23 18:03 ` Corey Minyard
2002-10-23 18:57 ` Dipankar Sarma
2002-10-23 20:14 ` [PATCH] NMI request/release, version 4 Corey Minyard
2002-10-23 20:50 ` Dipankar Sarma
2002-10-23 21:53 ` Corey Minyard
2002-10-24 7:41 ` Dipankar Sarma [this message]
2002-10-24 13:08 ` Corey Minyard
2002-10-24 7:50 ` Dipankar Sarma
2002-10-24 13:05 ` Corey Minyard
2002-10-24 13:28 ` [PATCH] NMI request/release, version 5 - I think this one's ready Corey Minyard
2002-10-24 14:46 ` John Levon
2002-10-24 15:36 ` Corey Minyard
2002-10-24 17:18 ` John Levon
2002-10-24 17:43 ` Corey Minyard
2002-10-24 18:04 ` John Levon
2002-10-24 18:32 ` Corey Minyard
2002-10-24 18:47 ` John Levon
2002-10-24 20:03 ` Corey Minyard
2002-10-24 20:29 ` John Levon
2002-10-25 1:22 ` [PATCH] NMI request/release, version 6 - "Well I thought the last one was ready" Corey Minyard
2002-10-25 1:39 ` John Levon
2002-10-25 1:58 ` Jeff Garzik
2002-10-25 2:01 ` [PATCH] NMI request/release, version 7 - minor cleanups Corey Minyard
2002-10-25 13:26 ` [PATCH] NMI request/release, version 8 Corey Minyard
2002-10-22 12:23 ` [PATCH] NMI request/release Suparna Bhattacharya
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=20021024131103.E27739@dikhow \
--to=dipankar@gamebox.net \
--cc=cminyard@mvista.com \
--cc=levon@movementarian.org \
--cc=linux-kernel@vger.kernel.org \
/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.