home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / wizards / 5294 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.9 KB

  1. Path: sparky!uunet!usc!howland.reston.ans.net!zaphod.mps.ohio-state.edu!swrinde!emory!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!gmdtub!ceres.fokus.gmd.de!jbm
  2. From: jbm@fokus.gmd.de (Joerg Micheel)
  3. Newsgroups: comp.unix.wizards
  4. Subject: Re: a novice unix internals question
  5. Message-ID: <1992Dec21.171809.11037@fokus.gmd.de>
  6. Date: 21 Dec 92 17:18:09 GMT
  7. References: <1992Dec16.081648.22123@sbcs.sunysb.edu> <1992Dec20.225210.9418@thunder.mcrcim.mcgill.edu>
  8. Sender: news@fokus.gmd.de (News system)
  9. Organization: GMD-Fokus (Berlin)
  10. Lines: 44
  11.  
  12. In article <1992Dec20.225210.9418@thunder.mcrcim.mcgill.edu>, mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
  13. |> In article <1992Dec16.081648.22123@sbcs.sunysb.edu>, synchem@sbcs.sunysb.edu (Synchem proj acct) writes:
  14. |> 
  15. |> > In the Leffler 4.3BSD Unix book, it was discussed that the run-time
  16. |> > structure of the kernel is divided into a top and a bottom half.
  17. |> > [...]  My question is, which process does the bottom half belong
  18. |> > to[?]
  19. |> 
  20. |> As you guess (in text I deleted), bottom-half routines do not
  21. |> inherently belong to any process.  If they correspond to a device that
  22. |> is being used by only one process, they could be thought of as
  23. |> belonging to that process, but the code is generally not written to
  24. |> correspond to this, and for some devices (eg, disks) it doesn't even
  25. |> really make sense.  There usually is some process current when the
  26. |> bottom half runs, but it bears no relation to anything in particular;
  27. |> it's simply whatever process happened to have the cpu when the
  28. |> interrupt happened.  If the machine isn't busy, it's even reasonably
  29. |> likely that the interrupt happened during the idle loop.  (For example,
  30. |> the bottom half cannot count on any given process being incore.  Some
  31. |> things are kept incore even for swapped processes, like the proc struct
  32. |> in 4.3; these can of course be used once the correct one is found.  But
  33. |> the u area may be swapped....)
  34.  
  35. I completely agree with you, but have to mention, that the deamon book isn't
  36. as strict as you with these semantics. In particular (page 46) Entry to the
  37. Kernel they say: "When a process enters the kernel trough a system call, a
  38. trap, or an interrupt, the kernel must ....". Aha. So the process currently
  39. running enters the kernel, when an interrupt occurs ?! Yes and no. I guess
  40. that CSRG people were just playing a bit with the term of a process (like:
  41. everybody dealing with these things knows, what happens, so why bother ? ;-).
  42. It's true, that the interrupt thread is completely unrelated to the process
  43. running, but the process get's charged for the time of interrupt processing
  44. (see the statement in kern_clock.c to hardclock()).
  45. I think that things might get clearer, when talking about threads instead
  46. of processes.
  47.  
  48. Just thoughts ...
  49.  
  50. Joerg 
  51.  
  52. -- 
  53. GMD    German National Research Center for Computer Science
  54. FOKUS    Open Communication Systems Research Center
  55.                             Berlin, Germany
  56.