public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dong Feng" <middle.fengdong@gmail.com>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: pradeep singh <2500.pradeep@gmail.com>,
	Bahadir Balban <bahadir.balban@gmail.com>,
	Learning Linux <learninglinux4@gmail.com>,
	kernelnewbies@nl.linux.org, linux-newbie@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Why can't we sleep in an ISR?
Date: Fri, 18 May 2007 07:50:50 +0800	[thread overview]
Message-ID: <a2ebde260705171650v6a8de642rde6e5c61261d9d5e@mail.gmail.com> (raw)
In-Reply-To: <464C7DA5.7070008@cfl.rr.com>

Hi, Phillip,

I have said the gap between you and me is the definition of context.
In Robert's definition, *context* is used in a classification method
and really something in higher-level. And I used that term to explain
why ISR can not sleep.

If you do not like the name, name it your way and substitute term
*context* in my previous mail with what you name. But I believe my
other explaination still hold, right?

And again, if anyway I am forced to use your termnology system, I
would also agree your other point regarding hardware.


2007/5/18, Phillip Susi <psusi@cfl.rr.com>:
> Dong Feng wrote:
> > OK. I think the gap between you and me is the definition of term
> > *context*. If you go to Linux Kernel Development, 2nd Edition (ISBN
> > 0-672-32720-1), Page 6, then you will read the following:
> >
> > ....  in Linux, ... each processor is doing one of three things at any
> > given moment:
> >
> > 1. In kernel-space, in process context, ...
> > 2. In kernel-space, in interrupt context, not associated with a process,
> > ...
> > 3. In user-space ...
> >
> > This list is inclusive. ...
>
> Yep, I disagree with that use of the term, because it is misleading and
> caused your confusion.  The context that the ISR executes in is not
> associated with a _known_ process is more correct.
>
> > Maybe you prefer other terminology system, but I do like the above
> > definition given by Robert Love. So maybe in your system *context*
> > mean something at hardware level and you say ISR is in process
> > context, but I think it is more like a logical level and agree with
> > Rovert's definition.
> >
> > And in hardware level, Robert's *context* definition also mean
> > something specific, that I started to be aware of. That is, *in the
> > same context* means a kernel-code is triggered by a user-space code.
> > *in different context* means a kernel-code is triggered by an external
> > interrupt source other than a user-space code.
>
> Right, and that becomes more clear when you say that the ISR's is
> executing in an indeterminate process context, rather than saying it
> does not have any context at all, or has its own special context.
>
> > Context has nothing to do with whether an ISR borrow any data
> > structure of a process, instead, its something logical or related to
> > causality.
>
> No, it has everything to do with the data structures of the process.
> When you are executing "in the same context" as you put it, as called
> from the user mode code, you know you are using the task structure of
> that process and so you can make use of that structure.  For example,
> you can look at the current uid to decide if you should allow an
> operation to proceed.  When you are in an ISR, there _is_ a task
> structure there, but you shouldn't use it because you don't know which
> task structure it is because you don't know which task you are
> interrupting.  Thus if you look at the current uid in an ISR, you have
> no idea what you will see there and it will change from interrupt to
> interrupt, depending on which task gets interrupted.
>
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs

  reply	other threads:[~2007-05-17 23:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14  6:37 Why can't we sleep in an ISR? Learning Linux
2007-05-14  7:10 ` pradeep singh
2007-05-14  7:16   ` Learning Linux
2007-05-14 15:24     ` Bahadir Balban
2007-05-14 15:56       ` Dong Feng
2007-05-15  5:17       ` pradeep singh
2007-05-15  6:45         ` Dong Feng
2007-05-15  7:10           ` pradeep singh
2007-05-15  7:28             ` Dong Feng
2007-05-15  8:12               ` pradeep singh
2007-05-15  8:40               ` Learning Linux
2007-05-15  8:58                 ` Dong Feng
2007-05-15 16:57           ` Phillip Susi
2007-05-15 22:49             ` Dong Feng
2007-05-16 15:20               ` Phillip Susi
2007-05-16 23:17                 ` Dong Feng
2007-05-17 16:07                   ` Phillip Susi
2007-05-17 23:50                     ` Dong Feng [this message]
2007-05-14 12:25 ` Helge Hafting
2007-05-14 12:52   ` pradeep singh
2007-05-14 13:36     ` Dong Feng
  -- strict thread matches above, loose matches on Subject: below --
2007-05-14 15:22 linux
2007-05-14 15:55 ` Rik van Riel
2007-05-15  9:34 rohit  hooda
2007-05-15  9:46 ` pradeep singh

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=a2ebde260705171650v6a8de642rde6e5c61261d9d5e@mail.gmail.com \
    --to=middle.fengdong@gmail.com \
    --cc=2500.pradeep@gmail.com \
    --cc=bahadir.balban@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=learninglinux4@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=psusi@cfl.rr.com \
    /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