From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Yubin Ruan <ablacktshirt@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: [Question] Quick Quiz B.13 help
Date: Mon, 13 Feb 2017 11:00:34 -0800 [thread overview]
Message-ID: <20170213190034.GI30506@linux.vnet.ibm.com> (raw)
In-Reply-To: <3fabc59b-f542-a121-3764-c4ac9eedc062@gmail.com>
On Mon, Feb 13, 2017 at 09:41:46PM +0800, Yubin Ruan wrote:
> Quick quiz B.13:
> Suppose that lines 3-5 for CPUs 1 and 2 in Table B.4 are in an
> interrupt handler, and that the CPU 2's line 9 is running at process
> level. What changes, if any, are required to enable the code to work
> correctly, in other words, to prevent the assertion from firing?
>
> I can not come up with any practical material for this quiz, because
> I don't really know the implication of "in an interrupt handler",
> and "running in process level".
>
> The answer hints that one would need to ensure that the load of "e"
> precedes that of "a" and hint the Linux kernel implementation
> "barrier()". But how is that exactly? I am going to invest some time
> into the Linux kernel implementation. But I would really appreciate
> some hints about this, as I don't have so much kernel development
> experience before.
I suggest reading an operating-system textbook. The ones I have are quite
old, but here they are anyway in bibtex format. There are probably newer
editions of some of them. The short answer on interrupts is that they
force process-level processing to pause while the "interrupt handler"
completes.
Thanx, Paul
------------------------------------------------------------------------
@book{CorbetRubiniKroahHartman
,author="Jonathan Corbet and Alessandro Rubini and Greg Kroah-Hartman"
,title="Linux Device Drivers"
,publisher="O'Reilly Media, Inc."
,year="2005"
,edition="Third"
}
@book{Silberschatz98a
,author="Abraham Silberschatz and Peter Baer Galvin"
,title="Operating System Concepts"
,publisher="Addison-Wesley"
,year="1998"
,edition="Fifth"
}
@book{Vahalia96
,author="Uresh Vahalia"
,title="{UNIX} Internals: The New Frontiers"
,publisher="Prentice Hall"
,year="1996"
}
next prev parent reply other threads:[~2017-02-13 19:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 13:41 [Question] Quick Quiz B.13 help Yubin Ruan
2017-02-13 19:00 ` Paul E. McKenney [this message]
2017-02-14 10:53 ` Yubin Ruan
2017-02-14 15:36 ` Akira Yokosawa
2017-02-16 19:13 ` Paul E. McKenney
2017-02-16 22:47 ` Akira Yokosawa
2017-02-19 22:22 ` Paul E. McKenney
2017-02-19 23:47 ` Akira Yokosawa
2017-02-20 0:51 ` Paul E. McKenney
2017-02-20 1:56 ` Akira Yokosawa
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=20170213190034.GI30506@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=ablacktshirt@gmail.com \
--cc=perfbook@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.