From: vishu.kernel@gmail.com (Vishwas Srivastava)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Kernelnewbies Digest, Vol 44, Issue 51
Date: Mon, 28 Jul 2014 22:58:59 +0530 [thread overview]
Message-ID: <CAGM3cC5nyf+wcOedCh=WfEK73zjH6bJeCC9Fp-=7DPqb7MLBjQ@mail.gmail.com> (raw)
In-Reply-To: <4E5779AD88B2F040B8A7E83ECF544D1A536535@SJCPEX01CL02.citrite.net>
Hi Jeff,
yes, your guess is correct. The place i checked in_interrupt()
was a region before which a call to spin_lock_bh() was made.
So what is the rule?
if in_interrupt() return me true then that is the region of the code which
can not be context switched or if i am out of interrupt (in kernel thread)
and have called spin_lock_bh(), then this macro is not reliable to safely
find out if the region below this can not be context switched?
If that is the case, then perhaps only the "false" return of the macro
in_interrupt is reliable.
thanks,
Vishwas S
On Mon, Jul 28, 2014 at 9:54 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:
>
>
> *From:* kernelnewbies-bounces at kernelnewbies.org [mailto:
> kernelnewbies-bounces at kernelnewbies.org] *On Behalf Of *Vishwas Srivastava
> *Sent:* Saturday, July 26, 2014 10:07 AM
> *To:* kernelnewbies at kernelnewbies.org
> *Subject:* Re: Kernelnewbies Digest, Vol 44, Issue 51
>
>
>
> Hi All,
>
> I have a doubt regarding the threaded interrupt handing
> mechanism.
>
> what is the kernel context of execution while executing interrupt thread.
>
> if i check for macro
>
> in_irq() or in_interrupt() withing handler thread , my understanding is
> that they both are going to return me 0 (since we are in kernel thread),
>
> as threads runs in process context.
>
>
>
> Also, since they are "kernel threads", they must be schedulable enteties.
>
> what conceptually deviated me from my understanding is one of the driver
> which had a threaded interrupt mechanism and when i checked
>
>
>
> in_interrupt() macro, it returned me a non zero value so i am a bit
> confused.
>
>
>
> By any chance had you disabled interrupts or bottom halves when you made
> this call to in_interrupt()?
>
> The reason I ask is the last time I looked into this the conclusion I came
> to was that in_interrupt() would return non-zero under a couple of
> different conditions; 1) the code was really executing in either a bottom
> half or IRQ context, or; 2) the code was executing in process context but
> had previously disabled interrupts or bottom halves, e.g. a call to
> spin_lock_bh() or anything else that disables bottom halves. At the time
> I was trying to figure out how to tell for sure whether or not a given
> function was being called from a bottom half (as opposed to executing in
> process context with bottom halves disabled) and from what I could see at
> the time, there was no way to distinguish the two conditions. Disclaimer:
> I?m no expert on this stuff, just reporting what I concluded at the time
> from eyeballing the code. Perhaps I missed something.
>
>
>
> Jeff Haran
>
>
>
> thanks in advance.
>
>
>
> Vishwas S
>
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140728/5d11cf26/attachment.html
next prev parent reply other threads:[~2014-07-28 17:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.412.1406325749.2642.kernelnewbies@kernelnewbies.org>
2014-07-26 17:07 ` Kernelnewbies Digest, Vol 44, Issue 51 Vishwas Srivastava
2014-07-28 16:24 ` Jeff Haran
2014-07-28 17:28 ` Vishwas Srivastava [this message]
[not found] ` <4E5779AD88B2F040B8A7E83ECF544D1A5366A6@SJCPEX01CL02.citrite.net>
2014-07-28 19:56 ` Vishwas Srivastava
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='CAGM3cC5nyf+wcOedCh=WfEK73zjH6bJeCC9Fp-=7DPqb7MLBjQ@mail.gmail.com' \
--to=vishu.kernel@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).