From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Zefang.Wang@nokia.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Any problem if softirq are done in a interrupt context (IRQ stack)?
Date: Wed, 3 Jan 2007 11:43:05 +0100 [thread overview]
Message-ID: <20070103104305.GA3100@atjola.homenet> (raw)
In-Reply-To: <1E9D602D891FA142A769E9EF164712EC355CB0@beebe101.NOE.Nokia.com>
[Re-added lkml to the CC list, please don't drop anything from CC]
On 2007.01.03 17:39:48 +0800, Zefang.Wang@nokia.com wrote:
> Hi!
>
> Thanks very much for your clear explanation !
>
> I have another question about irq_exit(), hope you can help me.
>
> void irq_exit(void)
> {
> account_system_vtime(current);
> trace_hardirq_exit();
> sub_preempt_count(IRQ_EXIT_OFFSET);
> ====================================================================
> Here, IRQ_EXIT_OFFSET is defined as (HARDIRQ_OFFSET-1),
> so the purpose seems that it try to avoid the current process
> from being switched-out druing do_softirq()?
> And, if the preempt_count is not zero, then softirq for
> timer interrupt can set _TIF_NEED_RESCHED flag to current
> process?
> What happened if the above sentence is changed to
> sub_preept_count(HARDIRQ_OFFSET)?
>
> if (!in_interrupt() && local_softirq_pending())
> invoke_softirq();
> preempt_enable_no_resched();
> ==============================================
> The remaining 1 is decremented here.
> }
I can't really help you with that one. I'd assume that you need to make
sure that the current process context is kept while the softirq is
running. Could be, that otherwise the process gets preempted and the
stored process context would be assigned to the new process or
something like that, but I'm just guessing wildly here.
Note that IRQ_EXIT_OFFSET is defined as HARDIRQ_OFFSET if preemption is
disabled, so that's probably key here, I just don't know what kind of
havoc preempting would cause here ;)
Björn
next prev parent reply other threads:[~2007-01-03 10:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 8:23 Zefang.Wang
2007-01-03 9:22 ` Björn Steinbrink
[not found] ` <1E9D602D891FA142A769E9EF164712EC355CB0@beebe101.NOE.Nokia.com>
2007-01-03 10:43 ` Björn Steinbrink [this message]
2007-01-23 19:48 ` Steven Rostedt
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=20070103104305.GA3100@atjola.homenet \
--to=b.steinbrink@gmx.de \
--cc=Zefang.Wang@nokia.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®