All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] Always generate perfbook.synctex.gz
       [not found] ` <2d2eb3d6-d050-6f0c-aca5-b0cc76e8e0ec@gmail.com>
@ 2019-10-19 11:43   ` Akira Yokosawa
  2019-10-19 15:35     ` Paul E. McKenney
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
  1 sibling, 1 reply; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-19 11:43 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Balbir Singh, Akira Yokosawa

On Fri, 18 Oct 2019 00:27:36 +0900, Akira Yokosawa wrote:
> From 41473d36c8bfaf96c4d0d0b3ca04f688ae6d4739 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Fri, 18 Oct 2019 00:12:24 +0900
> Subject: [PATCH v2] Always generate perfbook.synctex.gz
> 
> Commit 8458f7572335 ("Add optional flag 'LATEX_OPT' in run{first}latex.sh")
> was ment to support optinal generation of .synctex files.
> It turns out that evince and gedit pair supports both the forward
> (.tex -> PDF) and the inverse (PDF -> .tex) searches [1].
> I find this mechanism helps a lot in perfbook, because of its
> nested LaTeX source structure.
> 
> For forward search (.tex -> PDF) to work, each sub-sources needs
> to have a pointer to main file in the first/last 3 lines. This
> commit therefor adds the pointers to top level perfbook.tex.
> 
> Also add an entry in FAQ-BUILD.txt as an introduction of the
> capability.
> 
> Note: As SyncTeX search will work only for perfbook.pdf, other
> targets do not generate .synctex.gz.
> 
> [1]: https://help.gnome.org/users/evince/stable/synctex-search.html.en
> 
> Cc: Balbir Singh <bsingharora@gmail.com>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Changes from v1:
> 
> o Simplify setting of LATEX_OPT in Makefile. The behavior is the same as v1.
> o Add Cc: to Balbir.
> 
> I'd like to know this change has no regression with Balbir's workflow.
> I'm assuming Balbir's viewer and editor combination is something
> other than evince and gedit.

Paul, this change does have regression in that the inverse search
(PDF -> .tex) stops working other than perfbook.pdf.

Current master allows inverse search from any of perfbook*.pdf.

So, please hold off this one.

Let me try another round to enable forward search of SyncTeX.

        Thanks, Akira

> 
>         Thanks, Akira
> --
>  FAQ-BUILD.txt                             | 21 +++++++++++++++++++++
>  Makefile                                  |  5 +++++
>  SMPdesign/SMPdesign.tex                   |  2 ++
>  SMPdesign/beyond.tex                      |  4 +++-
>  SMPdesign/criteria.tex                    |  1 +
>  SMPdesign/partexercises.tex               |  2 ++
>  advsync/advsync.tex                       |  2 ++
>  advsync/rcu.tex                           |  2 ++
>  advsync/rt.tex                            |  2 ++
>  appendix/ack/ack.tex                      |  1 +
>  appendix/appendix.tex                     |  1 +
>  appendix/questions/after.tex              |  2 ++
>  appendix/questions/concurrentparallel.tex |  1 +
>  appendix/questions/questions.tex          |  1 +
>  appendix/questions/time.tex               |  1 +
>  appendix/styleguide/styleguide.tex        |  1 +
>  appendix/toyrcu/toyrcu.tex                |  2 ++
>  appendix/whymb/whymemorybarriers.tex      |  2 ++
>  count/count.tex                           |  2 ++
>  cpu/cpu.tex                               |  1 +
>  cpu/hwfreelunch.tex                       |  1 +
>  cpu/overheads.tex                         |  1 +
>  cpu/overview.tex                          |  2 ++
>  cpu/swdesign.tex                          |  1 +
>  datastruct/datastruct.tex                 |  2 ++
>  debugging/debugging.tex                   |  2 ++
>  defer/defer.tex                           |  1 +
>  defer/hazptr.tex                          |  1 +
>  defer/rcu.tex                             |  3 ++-
>  defer/rcuapi.tex                          |  4 +++-
>  defer/rcuexercises.tex                    |  1 +
>  defer/rcufundamental.tex                  |  2 ++
>  defer/rcuintro.tex                        |  2 ++
>  defer/rcurelated.tex                      |  2 ++
>  defer/rcuusage.tex                        |  2 ++
>  defer/refcnt.tex                          |  2 ++
>  defer/seqlock.tex                         |  2 ++
>  defer/updates.tex                         |  3 ++-
>  defer/whichtochoose.tex                   |  1 +
>  easy/easy.tex                             |  1 +
>  formal/axiomatic.tex                      |  2 ++
>  formal/dyntickrcu.tex                     |  2 ++
>  formal/formal.tex                         |  1 +
>  formal/ppcmem.tex                         |  4 +++-
>  formal/sat.tex                            |  1 +
>  formal/spinhint.tex                       |  2 ++
>  formal/stateless.tex                      |  1 +
>  future/cpu.tex                            |  1 +
>  future/formalregress.tex                  |  1 +
>  future/future.tex                         |  1 +
>  future/htm.tex                            |  2 ++
>  future/tm.tex                             |  2 ++
>  glossary.tex                              |  1 +
>  howto/howto.tex                           |  2 ++
>  intro/intro.tex                           |  1 +
>  legal.tex                                 |  1 +
>  locking/locking-existence.tex             |  4 +++-
>  locking/locking.tex                       |  2 ++
>  memalloc/memalloc.tex                     |  1 +
>  memorder/memorder.tex                     |  2 ++
>  owned/owned.tex                           |  2 ++
>  together/applyrcu.tex                     |  2 ++
>  together/count.tex                        |  1 +
>  together/hash.tex                         |  1 +
>  together/refcnt.tex                       |  2 ++
>  together/together.tex                     |  1 +
>  toolsoftrade/toolsoftrade.tex             |  2 ++
>  67 files changed, 131 insertions(+), 6 deletions(-)
> 
[...]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Always generate perfbook.synctex.gz
  2019-10-19 11:43   ` [PATCH v2] Always generate perfbook.synctex.gz Akira Yokosawa
@ 2019-10-19 15:35     ` Paul E. McKenney
  0 siblings, 0 replies; 12+ messages in thread
From: Paul E. McKenney @ 2019-10-19 15:35 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook, Balbir Singh

On Sat, Oct 19, 2019 at 08:43:39PM +0900, Akira Yokosawa wrote:
> On Fri, 18 Oct 2019 00:27:36 +0900, Akira Yokosawa wrote:
> > From 41473d36c8bfaf96c4d0d0b3ca04f688ae6d4739 Mon Sep 17 00:00:00 2001
> > From: Akira Yokosawa <akiyks@gmail.com>
> > Date: Fri, 18 Oct 2019 00:12:24 +0900
> > Subject: [PATCH v2] Always generate perfbook.synctex.gz
> > 
> > Commit 8458f7572335 ("Add optional flag 'LATEX_OPT' in run{first}latex.sh")
> > was ment to support optinal generation of .synctex files.
> > It turns out that evince and gedit pair supports both the forward
> > (.tex -> PDF) and the inverse (PDF -> .tex) searches [1].
> > I find this mechanism helps a lot in perfbook, because of its
> > nested LaTeX source structure.
> > 
> > For forward search (.tex -> PDF) to work, each sub-sources needs
> > to have a pointer to main file in the first/last 3 lines. This
> > commit therefor adds the pointers to top level perfbook.tex.
> > 
> > Also add an entry in FAQ-BUILD.txt as an introduction of the
> > capability.
> > 
> > Note: As SyncTeX search will work only for perfbook.pdf, other
> > targets do not generate .synctex.gz.
> > 
> > [1]: https://help.gnome.org/users/evince/stable/synctex-search.html.en
> > 
> > Cc: Balbir Singh <bsingharora@gmail.com>
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > ---
> > Changes from v1:
> > 
> > o Simplify setting of LATEX_OPT in Makefile. The behavior is the same as v1.
> > o Add Cc: to Balbir.
> > 
> > I'd like to know this change has no regression with Balbir's workflow.
> > I'm assuming Balbir's viewer and editor combination is something
> > other than evince and gedit.
> 
> Paul, this change does have regression in that the inverse search
> (PDF -> .tex) stops working other than perfbook.pdf.
> 
> Current master allows inverse search from any of perfbook*.pdf.
> 
> So, please hold off this one.

Will do, especially given that this email reached me and the one that
it replies to did not.  ;-)

> Let me try another round to enable forward search of SyncTeX.

Sounds good!

							Thanx, Paul

>         Thanks, Akira
> 
> > 
> >         Thanks, Akira
> > --
> >  FAQ-BUILD.txt                             | 21 +++++++++++++++++++++
> >  Makefile                                  |  5 +++++
> >  SMPdesign/SMPdesign.tex                   |  2 ++
> >  SMPdesign/beyond.tex                      |  4 +++-
> >  SMPdesign/criteria.tex                    |  1 +
> >  SMPdesign/partexercises.tex               |  2 ++
> >  advsync/advsync.tex                       |  2 ++
> >  advsync/rcu.tex                           |  2 ++
> >  advsync/rt.tex                            |  2 ++
> >  appendix/ack/ack.tex                      |  1 +
> >  appendix/appendix.tex                     |  1 +
> >  appendix/questions/after.tex              |  2 ++
> >  appendix/questions/concurrentparallel.tex |  1 +
> >  appendix/questions/questions.tex          |  1 +
> >  appendix/questions/time.tex               |  1 +
> >  appendix/styleguide/styleguide.tex        |  1 +
> >  appendix/toyrcu/toyrcu.tex                |  2 ++
> >  appendix/whymb/whymemorybarriers.tex      |  2 ++
> >  count/count.tex                           |  2 ++
> >  cpu/cpu.tex                               |  1 +
> >  cpu/hwfreelunch.tex                       |  1 +
> >  cpu/overheads.tex                         |  1 +
> >  cpu/overview.tex                          |  2 ++
> >  cpu/swdesign.tex                          |  1 +
> >  datastruct/datastruct.tex                 |  2 ++
> >  debugging/debugging.tex                   |  2 ++
> >  defer/defer.tex                           |  1 +
> >  defer/hazptr.tex                          |  1 +
> >  defer/rcu.tex                             |  3 ++-
> >  defer/rcuapi.tex                          |  4 +++-
> >  defer/rcuexercises.tex                    |  1 +
> >  defer/rcufundamental.tex                  |  2 ++
> >  defer/rcuintro.tex                        |  2 ++
> >  defer/rcurelated.tex                      |  2 ++
> >  defer/rcuusage.tex                        |  2 ++
> >  defer/refcnt.tex                          |  2 ++
> >  defer/seqlock.tex                         |  2 ++
> >  defer/updates.tex                         |  3 ++-
> >  defer/whichtochoose.tex                   |  1 +
> >  easy/easy.tex                             |  1 +
> >  formal/axiomatic.tex                      |  2 ++
> >  formal/dyntickrcu.tex                     |  2 ++
> >  formal/formal.tex                         |  1 +
> >  formal/ppcmem.tex                         |  4 +++-
> >  formal/sat.tex                            |  1 +
> >  formal/spinhint.tex                       |  2 ++
> >  formal/stateless.tex                      |  1 +
> >  future/cpu.tex                            |  1 +
> >  future/formalregress.tex                  |  1 +
> >  future/future.tex                         |  1 +
> >  future/htm.tex                            |  2 ++
> >  future/tm.tex                             |  2 ++
> >  glossary.tex                              |  1 +
> >  howto/howto.tex                           |  2 ++
> >  intro/intro.tex                           |  1 +
> >  legal.tex                                 |  1 +
> >  locking/locking-existence.tex             |  4 +++-
> >  locking/locking.tex                       |  2 ++
> >  memalloc/memalloc.tex                     |  1 +
> >  memorder/memorder.tex                     |  2 ++
> >  owned/owned.tex                           |  2 ++
> >  together/applyrcu.tex                     |  2 ++
> >  together/count.tex                        |  1 +
> >  together/hash.tex                         |  1 +
> >  together/refcnt.tex                       |  2 ++
> >  together/together.tex                     |  1 +
> >  toolsoftrade/toolsoftrade.tex             |  2 ++
> >  67 files changed, 131 insertions(+), 6 deletions(-)
> > 
> [...]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search
       [not found] ` <2d2eb3d6-d050-6f0c-aca5-b0cc76e8e0ec@gmail.com>
  2019-10-19 11:43   ` [PATCH v2] Always generate perfbook.synctex.gz Akira Yokosawa
@ 2019-10-22 11:15   ` Akira Yokosawa
  2019-10-22 11:17     ` [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files Akira Yokosawa
                       ` (6 more replies)
  1 sibling, 7 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:15 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh, Akira Yokosawa

Hi Paul,

Here is another attempt to enable SyncTeX forward search in perfbook.

This time, perfbook.synctex.gz will be generated only if you
set the environment variable LATEX_OPT=-synctex=1. The behavior
is not changed from current master.

I said in my reply to v2:

    ... this change does have regression in that the inverse search
    (PDF -> .tex) stops working other than perfbook.pdf.

It tuned out this was my misconception. Inverse search works
from other than perfbook.pdf with the "% mainfile: ...perfbook.tex"
lines added to sub .tex files.

So, patch #1 adds the "mainfile:" tags (pointing perfbook.tex) in
sub .tex files.
Patch #2 adds a script to retarget the destination of forward search
by modifying the "mainfile:" tags. It does nothing when LATEX_OPT
has no "synctex" setting.  For the details of the script, please
refer to the update of FAQ-BUILD.txt in patch #4.
Patch #3 adds "mainfile:" lines in extracted .tex files (qqz.tex,
origpub.tex, and contrib.tex).
Patch #4 updates FAQ-BUILD.txt to mention SyncTeX support in
perfbook.

Patches #5 and #6 update minor issues I noticed during the test
of SyncTeX search with perfbook-1c.pdf.

I don't think gedit is your choice of editor, but SyncTeX surely
helps in locating a particular .tex file you'd like to see.

Forward search is not complete in that it doesn't work in
.fcv files. It looks like gedit's SyncTeX support is sensitive
to suffix of .tex. I tried to add "mainfile" tags in .fcv files
on the fly, but ended up in vain.  Inverse search to .fcv files
works as expected.  There is a room of improvement to show where
those .fcv files come from. I'll see what can be done.

        Thanks, Akira
--
Akira Yokosawa (6):
  treewide: Add '% mainfile:' tags in headers in sub .tex files
  Add synctex-forward.sh
  Add output of '% mainfile: perfbook.tex' tags in extraction scripts
  FAQ-BUILD: Mention how to enable SyncTeX support
  defer/rcuintro: Convert snippet to new scheme
  defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout

 FAQ-BUILD.txt                             | 39 ++++++++++
 SMPdesign/SMPdesign.tex                   |  2 +
 SMPdesign/beyond.tex                      |  4 +-
 SMPdesign/criteria.tex                    |  1 +
 SMPdesign/partexercises.tex               |  2 +
 advsync/advsync.tex                       |  2 +
 advsync/rcu.tex                           |  2 +
 advsync/rt.tex                            |  2 +
 appendix/ack/ack.tex                      |  1 +
 appendix/appendix.tex                     |  1 +
 appendix/questions/after.tex              |  2 +
 appendix/questions/concurrentparallel.tex |  1 +
 appendix/questions/questions.tex          |  1 +
 appendix/questions/time.tex               |  1 +
 appendix/styleguide/styleguide.tex        |  1 +
 appendix/toyrcu/toyrcu.tex                |  2 +
 appendix/whymb/whymemorybarriers.tex      |  2 +
 count/count.tex                           |  2 +
 cpu/cpu.tex                               |  1 +
 cpu/hwfreelunch.tex                       |  1 +
 cpu/overheads.tex                         |  1 +
 cpu/overview.tex                          |  2 +
 cpu/swdesign.tex                          |  1 +
 datastruct/datastruct.tex                 |  2 +
 debugging/debugging.tex                   |  2 +
 defer/defer.tex                           |  1 +
 defer/hazptr.tex                          |  1 +
 defer/rcu.tex                             |  3 +-
 defer/rcuapi.tex                          |  6 +-
 defer/rcuexercises.tex                    |  1 +
 defer/rcufundamental.tex                  |  2 +
 defer/rcuintro.tex                        | 58 +++++++--------
 defer/rcurelated.tex                      |  2 +
 defer/rcuusage.tex                        |  2 +
 defer/refcnt.tex                          |  2 +
 defer/seqlock.tex                         |  2 +
 defer/updates.tex                         |  3 +-
 defer/whichtochoose.tex                   |  1 +
 easy/easy.tex                             |  1 +
 formal/axiomatic.tex                      |  2 +
 formal/dyntickrcu.tex                     |  2 +
 formal/formal.tex                         |  1 +
 formal/ppcmem.tex                         |  4 +-
 formal/sat.tex                            |  1 +
 formal/spinhint.tex                       |  2 +
 formal/stateless.tex                      |  1 +
 future/cpu.tex                            |  1 +
 future/formalregress.tex                  |  1 +
 future/future.tex                         |  1 +
 future/htm.tex                            |  2 +
 future/tm.tex                             |  2 +
 glossary.tex                              |  1 +
 howto/howto.tex                           |  2 +
 intro/intro.tex                           |  1 +
 legal.tex                                 |  1 +
 locking/locking-existence.tex             |  4 +-
 locking/locking.tex                       |  2 +
 memalloc/memalloc.tex                     |  1 +
 memorder/memorder.tex                     |  2 +
 owned/owned.tex                           |  2 +
 together/applyrcu.tex                     |  2 +
 together/count.tex                        |  1 +
 together/hash.tex                         |  1 +
 together/refcnt.tex                       |  2 +
 together/together.tex                     |  1 +
 toolsoftrade/toolsoftrade.tex             |  2 +
 utilities/extractcontrib.sh               |  1 +
 utilities/extractorigpub.sh               |  1 +
 utilities/extractqqz.sh                   |  1 +
 utilities/synctex-forward.sh              | 91 +++++++++++++++++++++++
 70 files changed, 266 insertions(+), 36 deletions(-)
 create mode 100755 utilities/synctex-forward.sh

-- 
2.17.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
@ 2019-10-22 11:17     ` Akira Yokosawa
  2019-10-22 11:19     ` [PATCH v3 2/6] Add synctex-forward.sh Akira Yokosawa
                       ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:17 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From f27c8e9ab71a7f6a6f12ac21e2469d26330de36c Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 19 Oct 2019 20:44:40 +0900
Subject: [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files

These tags enable SyncTeX forward search from gedit to evince.
Also fill in missing sub-directory names and SPDX License Identifiers.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 SMPdesign/SMPdesign.tex                   | 2 ++
 SMPdesign/beyond.tex                      | 4 +++-
 SMPdesign/criteria.tex                    | 1 +
 SMPdesign/partexercises.tex               | 2 ++
 advsync/advsync.tex                       | 2 ++
 advsync/rcu.tex                           | 2 ++
 advsync/rt.tex                            | 2 ++
 appendix/ack/ack.tex                      | 1 +
 appendix/appendix.tex                     | 1 +
 appendix/questions/after.tex              | 2 ++
 appendix/questions/concurrentparallel.tex | 1 +
 appendix/questions/questions.tex          | 1 +
 appendix/questions/time.tex               | 1 +
 appendix/styleguide/styleguide.tex        | 1 +
 appendix/toyrcu/toyrcu.tex                | 2 ++
 appendix/whymb/whymemorybarriers.tex      | 2 ++
 count/count.tex                           | 2 ++
 cpu/cpu.tex                               | 1 +
 cpu/hwfreelunch.tex                       | 1 +
 cpu/overheads.tex                         | 1 +
 cpu/overview.tex                          | 2 ++
 cpu/swdesign.tex                          | 1 +
 datastruct/datastruct.tex                 | 2 ++
 debugging/debugging.tex                   | 2 ++
 defer/defer.tex                           | 1 +
 defer/hazptr.tex                          | 1 +
 defer/rcu.tex                             | 3 ++-
 defer/rcuapi.tex                          | 2 ++
 defer/rcuexercises.tex                    | 1 +
 defer/rcufundamental.tex                  | 2 ++
 defer/rcuintro.tex                        | 2 ++
 defer/rcurelated.tex                      | 2 ++
 defer/rcuusage.tex                        | 2 ++
 defer/refcnt.tex                          | 2 ++
 defer/seqlock.tex                         | 2 ++
 defer/updates.tex                         | 3 ++-
 defer/whichtochoose.tex                   | 1 +
 easy/easy.tex                             | 1 +
 formal/axiomatic.tex                      | 2 ++
 formal/dyntickrcu.tex                     | 2 ++
 formal/formal.tex                         | 1 +
 formal/ppcmem.tex                         | 4 +++-
 formal/sat.tex                            | 1 +
 formal/spinhint.tex                       | 2 ++
 formal/stateless.tex                      | 1 +
 future/cpu.tex                            | 1 +
 future/formalregress.tex                  | 1 +
 future/future.tex                         | 1 +
 future/htm.tex                            | 2 ++
 future/tm.tex                             | 2 ++
 glossary.tex                              | 1 +
 howto/howto.tex                           | 2 ++
 intro/intro.tex                           | 1 +
 legal.tex                                 | 1 +
 locking/locking-existence.tex             | 4 +++-
 locking/locking.tex                       | 2 ++
 memalloc/memalloc.tex                     | 1 +
 memorder/memorder.tex                     | 2 ++
 owned/owned.tex                           | 2 ++
 together/applyrcu.tex                     | 2 ++
 together/count.tex                        | 1 +
 together/hash.tex                         | 1 +
 together/refcnt.tex                       | 2 ++
 together/together.tex                     | 1 +
 toolsoftrade/toolsoftrade.tex             | 2 ++
 65 files changed, 104 insertions(+), 5 deletions(-)

diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
index 045cd50e..0d351678 100644
--- a/SMPdesign/SMPdesign.tex
+++ b/SMPdesign/SMPdesign.tex
@@ -1,4 +1,6 @@
 % SMPdesign/SMPdesign.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{cha:Partitioning and Synchronization Design}{Partitioning and Synchronization Design}
 %
diff --git a/SMPdesign/beyond.tex b/SMPdesign/beyond.tex
index 40968c5a..0c0f9cb5 100644
--- a/SMPdesign/beyond.tex
+++ b/SMPdesign/beyond.tex
@@ -1,4 +1,6 @@
-% beyond.tex
+% SMPdesign/beyond.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Beyond Partitioning}
 \label{sec:SMPdesign:Beyond Partitioning}
diff --git a/SMPdesign/criteria.tex b/SMPdesign/criteria.tex
index 0b8f4a96..56657fca 100644
--- a/SMPdesign/criteria.tex
+++ b/SMPdesign/criteria.tex
@@ -1,4 +1,5 @@
 % SMPdesign/criteria.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Design Criteria}
diff --git a/SMPdesign/partexercises.tex b/SMPdesign/partexercises.tex
index e56f8eeb..5ac0ac30 100644
--- a/SMPdesign/partexercises.tex
+++ b/SMPdesign/partexercises.tex
@@ -1,4 +1,6 @@
 % SMPdesign/partexercises.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Partitioning Exercises}
 \label{sec:SMPdesign:Partitioning Exercises}
diff --git a/advsync/advsync.tex b/advsync/advsync.tex
index 304cf85b..f1a19ccc 100644
--- a/advsync/advsync.tex
+++ b/advsync/advsync.tex
@@ -1,4 +1,6 @@
 % advsync/advsync.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{sec:advsync:Advanced Synchronization}{Advanced Synchronization}
 %
diff --git a/advsync/rcu.tex b/advsync/rcu.tex
index ac5357ec..33335235 100644
--- a/advsync/rcu.tex
+++ b/advsync/rcu.tex
@@ -1,4 +1,6 @@
 % advsync/rcu.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Read-Copy Update}
 \label{sec:advsync:Read-Copy Update}
diff --git a/advsync/rt.tex b/advsync/rt.tex
index 16f4d2ef..c55ad3dc 100644
--- a/advsync/rt.tex
+++ b/advsync/rt.tex
@@ -1,4 +1,6 @@
 % advsync/rt.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Parallel Real-Time Computing}
 \label{sec:advsync:Parallel Real-Time Computing}
diff --git a/appendix/ack/ack.tex b/appendix/ack/ack.tex
index de06eb38..3a84bb36 100644
--- a/appendix/ack/ack.tex
+++ b/appendix/ack/ack.tex
@@ -1,4 +1,5 @@
 % appendix/ack/ack.tex
+% mainfile: ../../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \chapter{Credits}
diff --git a/appendix/appendix.tex b/appendix/appendix.tex
index 7b0d5c76..bb73e813 100644
--- a/appendix/appendix.tex
+++ b/appendix/appendix.tex
@@ -1,4 +1,5 @@
 % appendix/appendix.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \include{appendix/questions/questions}
diff --git a/appendix/questions/after.tex b/appendix/questions/after.tex
index 5e83fc43..c56621bd 100644
--- a/appendix/questions/after.tex
+++ b/appendix/questions/after.tex
@@ -1,4 +1,6 @@
 % appendix/questions/after.tex
+% mainfile: ../../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{What Does ``After'' Mean?}
 \label{sec:app:questions:What Does ``After'' Mean?}
diff --git a/appendix/questions/concurrentparallel.tex b/appendix/questions/concurrentparallel.tex
index 76b3d8ae..d10f544d 100644
--- a/appendix/questions/concurrentparallel.tex
+++ b/appendix/questions/concurrentparallel.tex
@@ -1,4 +1,5 @@
 % appendix/questions/concurrentparallel.tex
+% mainfile: ../../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{What is the Difference Between ``Concurrent'' and ``Parallel''?}
diff --git a/appendix/questions/questions.tex b/appendix/questions/questions.tex
index 54d9df12..6d7dc5ff 100644
--- a/appendix/questions/questions.tex
+++ b/appendix/questions/questions.tex
@@ -1,4 +1,5 @@
 % appendix/questions/questions.tex
+% mainfile: ../../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{cha:app:Important Questions}{Important Questions}
diff --git a/appendix/questions/time.tex b/appendix/questions/time.tex
index 017d44e0..39bdf9cc 100644
--- a/appendix/questions/time.tex
+++ b/appendix/questions/time.tex
@@ -1,4 +1,5 @@
 % appendix/questions/time.tex
+% mainfile: ../../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{What Time Is It?}
diff --git a/appendix/styleguide/styleguide.tex b/appendix/styleguide/styleguide.tex
index 1fdf6e11..91064b1e 100644
--- a/appendix/styleguide/styleguide.tex
+++ b/appendix/styleguide/styleguide.tex
@@ -1,4 +1,5 @@
 % appendix/styleguide/styleguide.tex
+% mainfile: ../../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \chapter{Style Guide}
diff --git a/appendix/toyrcu/toyrcu.tex b/appendix/toyrcu/toyrcu.tex
index 3bb1f1e4..7b53ebab 100644
--- a/appendix/toyrcu/toyrcu.tex
+++ b/appendix/toyrcu/toyrcu.tex
@@ -1,4 +1,6 @@
 % appendix/toyrcu/toyrcu.tex
+% mainfile: ../../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:app:``Toy'' RCU Implementations}{``Toy'' RCU Implementations}
 
diff --git a/appendix/whymb/whymemorybarriers.tex b/appendix/whymb/whymemorybarriers.tex
index 803aebac..7d5e1f5c 100644
--- a/appendix/whymb/whymemorybarriers.tex
+++ b/appendix/whymb/whymemorybarriers.tex
@@ -1,4 +1,6 @@
 % appendix/whymb/whymemorybarriers.tex
+% mainfile: ../../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:app:whymb:Why Memory Barriers?}{Why Memory Barriers?}
 
diff --git a/count/count.tex b/count/count.tex
index 61a11f5e..484c69af 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -1,4 +1,6 @@
 % count/count.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Counting}{Counting}
 %
diff --git a/cpu/cpu.tex b/cpu/cpu.tex
index c3dd9fa7..401f7132 100644
--- a/cpu/cpu.tex
+++ b/cpu/cpu.tex
@@ -1,4 +1,5 @@
 % cpu/cpu.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Hardware and its Habits}{Hardware and its Habits}
diff --git a/cpu/hwfreelunch.tex b/cpu/hwfreelunch.tex
index ca814b48..e0be6e0e 100644
--- a/cpu/hwfreelunch.tex
+++ b/cpu/hwfreelunch.tex
@@ -1,4 +1,5 @@
 % cpu/hwfreelunch.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Hardware Free Lunch?}
diff --git a/cpu/overheads.tex b/cpu/overheads.tex
index dbe73bfc..99abee89 100644
--- a/cpu/overheads.tex
+++ b/cpu/overheads.tex
@@ -1,4 +1,5 @@
 % cpu/overheads.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Overheads}
diff --git a/cpu/overview.tex b/cpu/overview.tex
index 73ed2909..12be1158 100644
--- a/cpu/overview.tex
+++ b/cpu/overview.tex
@@ -1,4 +1,6 @@
 % cpu/overview.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Overview}
 \label{sec:cpu:Overview}
diff --git a/cpu/swdesign.tex b/cpu/swdesign.tex
index 869c0f25..3c127b61 100644
--- a/cpu/swdesign.tex
+++ b/cpu/swdesign.tex
@@ -1,4 +1,5 @@
 % cpu/swdesign.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Software Design Implications}
diff --git a/datastruct/datastruct.tex b/datastruct/datastruct.tex
index 2cb698b6..c4d0817d 100644
--- a/datastruct/datastruct.tex
+++ b/datastruct/datastruct.tex
@@ -1,4 +1,6 @@
 % datastruct/datastruct.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Data Structures}{Data Structures}
 %
diff --git a/debugging/debugging.tex b/debugging/debugging.tex
index fc5e16e3..20436845 100644
--- a/debugging/debugging.tex
+++ b/debugging/debugging.tex
@@ -1,4 +1,6 @@
 % debugging/debugging.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Validation}{Validation}
 %
diff --git a/defer/defer.tex b/defer/defer.tex
index e67e024f..8323de6b 100644
--- a/defer/defer.tex
+++ b/defer/defer.tex
@@ -1,4 +1,5 @@
 % defer/defer.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Deferred Processing}{Deferred Processing}
diff --git a/defer/hazptr.tex b/defer/hazptr.tex
index f384e804..8c9ac7e4 100644
--- a/defer/hazptr.tex
+++ b/defer/hazptr.tex
@@ -1,4 +1,5 @@
 % defer/hazptr.tex
+% mainfile: ../perfbook.tex
 % From an C++ Standards Committee meeting:  "Can I hazptr cheezeberger?"
 
 \section{Hazard Pointers}
diff --git a/defer/rcu.tex b/defer/rcu.tex
index ac982aaa..d7b7418d 100644
--- a/defer/rcu.tex
+++ b/defer/rcu.tex
@@ -1,4 +1,5 @@
-% rcu.tex
+% defer/rcu.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Read-Copy Update (RCU)}
diff --git a/defer/rcuapi.tex b/defer/rcuapi.tex
index ae0e3e2b..47bb2da2 100644
--- a/defer/rcuapi.tex
+++ b/defer/rcuapi.tex
@@ -1,4 +1,6 @@
 % defer/rcuAPI.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{RCU Linux-Kernel API}
 \label{sec:defer:RCU Linux-Kernel API}
diff --git a/defer/rcuexercises.tex b/defer/rcuexercises.tex
index c4592454..3dfa514e 100644
--- a/defer/rcuexercises.tex
+++ b/defer/rcuexercises.tex
@@ -1,4 +1,5 @@
 % defer/rcuexercises.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{RCU Exercises}
diff --git a/defer/rcufundamental.tex b/defer/rcufundamental.tex
index 3e341950..562333f4 100644
--- a/defer/rcufundamental.tex
+++ b/defer/rcufundamental.tex
@@ -1,4 +1,6 @@
 % defer/rcufundamental.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{RCU Fundamentals}
 \label{sec:defer:RCU Fundamentals}
diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
index 5633818e..b9b9400e 100644
--- a/defer/rcuintro.tex
+++ b/defer/rcuintro.tex
@@ -1,4 +1,6 @@
 % defer/rcuintro.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{Introduction to RCU}
 \label{sec:defer:Introduction to RCU}
diff --git a/defer/rcurelated.tex b/defer/rcurelated.tex
index 32fd3457..dba9000e 100644
--- a/defer/rcurelated.tex
+++ b/defer/rcurelated.tex
@@ -1,4 +1,6 @@
 % defer/rcurelated.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{RCU Related Work}
 \label{sec:defer:RCU Related Work}
diff --git a/defer/rcuusage.tex b/defer/rcuusage.tex
index 16bf8603..9ccc0c92 100644
--- a/defer/rcuusage.tex
+++ b/defer/rcuusage.tex
@@ -1,4 +1,6 @@
 % defer/rcuusage.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \subsection{RCU Usage}
 \label{sec:defer:RCU Usage}
diff --git a/defer/refcnt.tex b/defer/refcnt.tex
index f3853897..91a2f346 100644
--- a/defer/refcnt.tex
+++ b/defer/refcnt.tex
@@ -1,4 +1,6 @@
 % defer/refcnt.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Reference Counting}
 \label{sec:defer:Reference Counting}
diff --git a/defer/seqlock.tex b/defer/seqlock.tex
index 6c48fd3b..0e9b74e8 100644
--- a/defer/seqlock.tex
+++ b/defer/seqlock.tex
@@ -1,4 +1,6 @@
 % defer/seqlock.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Sequence Locks}
 \label{sec:defer:Sequence Locks}
diff --git a/defer/updates.tex b/defer/updates.tex
index d3ab0f2f..df52d124 100644
--- a/defer/updates.tex
+++ b/defer/updates.tex
@@ -1,4 +1,5 @@
-% updates.tex
+% defer/updates.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{What About Updates?}
diff --git a/defer/whichtochoose.tex b/defer/whichtochoose.tex
index 15df46a3..5c54e6c8 100644
--- a/defer/whichtochoose.tex
+++ b/defer/whichtochoose.tex
@@ -1,4 +1,5 @@
 % defer/whichtochoose.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Which to Choose?}
diff --git a/easy/easy.tex b/easy/easy.tex
index daee76fb..aaf48d89 100644
--- a/easy/easy.tex
+++ b/easy/easy.tex
@@ -1,4 +1,5 @@
 % easy/easy.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Ease of Use}{Ease of Use}
diff --git a/formal/axiomatic.tex b/formal/axiomatic.tex
index 230fa9ce..e681a84e 100644
--- a/formal/axiomatic.tex
+++ b/formal/axiomatic.tex
@@ -1,4 +1,6 @@
 % formal/axiomatic.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Axiomatic Approaches}
 \label{sec:formal:Axiomatic Approaches}
diff --git a/formal/dyntickrcu.tex b/formal/dyntickrcu.tex
index 7f0c6ac2..c2b9569f 100644
--- a/formal/dyntickrcu.tex
+++ b/formal/dyntickrcu.tex
@@ -1,4 +1,6 @@
 % formal/dyntickrcu.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 % Disable frame around VerbatimN in two-column layout
 \IfTwoColumn{
diff --git a/formal/formal.tex b/formal/formal.tex
index 80ea5bd3..d0ea4bcb 100644
--- a/formal/formal.tex
+++ b/formal/formal.tex
@@ -1,4 +1,5 @@
 % formal/formal.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Formal Verification}{Formal Verification}
diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
index 67b59572..2e9264fc 100644
--- a/formal/ppcmem.tex
+++ b/formal/ppcmem.tex
@@ -1,4 +1,6 @@
-% ppcmem.tex
+% formal/ppcmem.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Special-Purpose State-Space Search}
 \label{sec:formal:Special-Purpose State-Space Search}
diff --git a/formal/sat.tex b/formal/sat.tex
index 8cb00886..30d19746 100644
--- a/formal/sat.tex
+++ b/formal/sat.tex
@@ -1,4 +1,5 @@
 % formal/sat.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{SAT Solvers}
diff --git a/formal/spinhint.tex b/formal/spinhint.tex
index bae4ddaf..0356d1bf 100644
--- a/formal/spinhint.tex
+++ b/formal/spinhint.tex
@@ -1,4 +1,6 @@
 % formal/spinhint.html
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{State-Space Search}
 \label{sec:formal:State-Space Search}
diff --git a/formal/stateless.tex b/formal/stateless.tex
index 62734c27..17c63e67 100644
--- a/formal/stateless.tex
+++ b/formal/stateless.tex
@@ -1,4 +1,5 @@
 % formal/stateless.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Stateless Model Checkers}
diff --git a/future/cpu.tex b/future/cpu.tex
index be97b68a..a503989c 100644
--- a/future/cpu.tex
+++ b/future/cpu.tex
@@ -1,4 +1,5 @@
 % future/cpu.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{The Future of CPU Technology Ain't What it Used to Be}
diff --git a/future/formalregress.tex b/future/formalregress.tex
index b827a56c..7ce585e4 100644
--- a/future/formalregress.tex
+++ b/future/formalregress.tex
@@ -1,4 +1,5 @@
 % future/formalregress.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Formal Regression Testing?}
diff --git a/future/future.tex b/future/future.tex
index 7e256ac0..7c7f03c2 100644
--- a/future/future.tex
+++ b/future/future.tex
@@ -1,4 +1,5 @@
 % future/future.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Conflicting Visions of the Future}{Conflicting Visions of the Future}
diff --git a/future/htm.tex b/future/htm.tex
index 03d8de1e..ca9d3bb0 100644
--- a/future/htm.tex
+++ b/future/htm.tex
@@ -1,4 +1,6 @@
 % future/htm.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Hardware Transactional Memory}
 \label{sec:future:Hardware Transactional Memory}
diff --git a/future/tm.tex b/future/tm.tex
index 1a4f1b1b..a5081762 100644
--- a/future/tm.tex
+++ b/future/tm.tex
@@ -1,4 +1,6 @@
 % future/tm.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Transactional Memory}
 \label{sec:future:Transactional Memory}
diff --git a/glossary.tex b/glossary.tex
index 9bd40248..532c8a16 100644
--- a/glossary.tex
+++ b/glossary.tex
@@ -1,4 +1,5 @@
 % glossary.tex
+% mainfile: perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \chapter{Glossary and Bibliography}
diff --git a/howto/howto.tex b/howto/howto.tex
index 3bdec595..bbdacbf1 100644
--- a/howto/howto.tex
+++ b/howto/howto.tex
@@ -1,4 +1,6 @@
 % howto/howto.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:How To Use This Book}{How To Use This Book}
 %
diff --git a/intro/intro.tex b/intro/intro.tex
index 5eb6976a..5cde0b6b 100644
--- a/intro/intro.tex
+++ b/intro/intro.tex
@@ -1,4 +1,5 @@
 % intro/intro.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Introduction}{Introduction}
diff --git a/legal.tex b/legal.tex
index d589d31e..7c827795 100644
--- a/legal.tex
+++ b/legal.tex
@@ -1,4 +1,5 @@
 % legal.tex
+% mainfile: perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section*{Legal Statement}
diff --git a/locking/locking-existence.tex b/locking/locking-existence.tex
index 0be581a2..294e5176 100644
--- a/locking/locking-existence.tex
+++ b/locking/locking-existence.tex
@@ -1,4 +1,6 @@
-% locking-existence.tex
+% locking/locking-existence.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Lock-Based Existence Guarantees}
 \label{sec:locking:Lock-Based Existence Guarantees}
diff --git a/locking/locking.tex b/locking/locking.tex
index c069b458..c088d051 100644
--- a/locking/locking.tex
+++ b/locking/locking.tex
@@ -1,4 +1,6 @@
 % locking/locking.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Locking}{Locking}
 %
diff --git a/memalloc/memalloc.tex b/memalloc/memalloc.tex
index dfbb14a0..efd2776b 100644
--- a/memalloc/memalloc.tex
+++ b/memalloc/memalloc.tex
@@ -1,4 +1,5 @@
 % memalloc/memalloc.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \chapter{Memory Allocation}
diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index c686beb9..ffb8c796 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -1,4 +1,6 @@
 % memorder/memorder.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Advanced Synchronization: Memory Ordering}{Advanced Synchronization: Memory Ordering}
 \OriginallyPublished{Chapter}{chp:Advanced Synchronization: Memory Ordering}{Advanced Synchronization: Memory Ordering}{the Linux kernel}{Howells2009membartxt}
diff --git a/owned/owned.tex b/owned/owned.tex
index 989fc067..6960f68e 100644
--- a/owned/owned.tex
+++ b/owned/owned.tex
@@ -1,4 +1,6 @@
 % owned/owned.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Data Ownership}{Data Ownership}
 %
diff --git a/together/applyrcu.tex b/together/applyrcu.tex
index 9cb733bf..6f5c04dc 100644
--- a/together/applyrcu.tex
+++ b/together/applyrcu.tex
@@ -1,4 +1,6 @@
 % together/applyrcu.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{RCU Rescues}
 \label{sec:together:RCU Rescues}
diff --git a/together/count.tex b/together/count.tex
index 50766cad..0374d396 100644
--- a/together/count.tex
+++ b/together/count.tex
@@ -1,4 +1,5 @@
 % together/count.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Counter Conundrums}
diff --git a/together/hash.tex b/together/hash.tex
index d98f0ec3..e3ca7f81 100644
--- a/together/hash.tex
+++ b/together/hash.tex
@@ -1,4 +1,5 @@
 % together/hash.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Hashing Hassles}
diff --git a/together/refcnt.tex b/together/refcnt.tex
index aaecad4e..26e053a3 100644
--- a/together/refcnt.tex
+++ b/together/refcnt.tex
@@ -1,4 +1,6 @@
 % together/refcnt.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \section{Refurbish Reference Counting}
 \label{sec:together:Refurbish Reference Counting}
diff --git a/together/together.tex b/together/together.tex
index 81475678..88eb9568 100644
--- a/together/together.tex
+++ b/together/together.tex
@@ -1,4 +1,5 @@
 % together/together.tex
+% mainfile: ../perfbook.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Putting It All Together}{Putting It All Together}
diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index 1c755d48..b4c1e044 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -1,4 +1,6 @@
 % toolsoftrade/toolsoftrade.tex
+% mainfile: ../perfbook.tex
+% SPDX-License-Identifier: CC-BY-SA-3.0
 
 \QuickQuizChapter{chp:Tools of the Trade}{Tools of the Trade}
 %
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/6] Add synctex-forward.sh
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
  2019-10-22 11:17     ` [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files Akira Yokosawa
@ 2019-10-22 11:19     ` Akira Yokosawa
  2019-10-22 11:21     ` [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts Akira Yokosawa
                       ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:19 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From 967beab61d94f966c06f245b9c22e1e702d6c785 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 20 Oct 2019 00:51:00 +0900
Subject: [PATCH v3 2/6] Add synctex-forward.sh

This script sets up "% mainfile:" tags in sub .tex files with
a suitable "perfbook-xx.tex" file name.
They enable SyncTeX forward search to perfbook-xx.pdf.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 utilities/synctex-forward.sh | 89 ++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100755 utilities/synctex-forward.sh

diff --git a/utilities/synctex-forward.sh b/utilities/synctex-forward.sh
new file mode 100755
index 00000000..312f9cc3
--- /dev/null
+++ b/utilities/synctex-forward.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Set "% mainfile:" lines with proper "% mainfile: <...>" tags in
+# sub .tex files.
+#
+# With no argument, the main file will be "perfbook.tex",
+# which will do nothing by default.
+# With abbrev target such as "1c", "hb", and so on, the main file
+# will be "perfbook-1c.tex", perfbook-hb.tex", and so on.
+#
+# Depth of subdirectory is deduced from the path of each sub .tex file.
+#
+# Changes made by this script can be reverted by running without
+# argument.
+#
+# WARNING: By runnig this script, your working tree will be modified.
+# It is highly recommented to commit your changes before running
+# this script.
+
+# If LATEX_OPT does not have "synctex", do nothing
+if ! echo $LATEX_OPT | grep -q synctex ; then
+	echo "LATEX_OPT has no synctex option. Exiting..."
+	exit 1
+fi
+
+# warn if git status is not clean later
+gitstatus=`git status --porcelain | wc -l`
+if [ $gitstatus != "0" ] ; then
+	wasnotclean=1
+else
+	wasnotclean=0
+fi
+
+if [ $# -eq 0 ] ; then
+	main="perfbook.tex"
+	change="reverted"
+else
+	case $1 in
+	2c)
+		main="perfbook.tex"
+		change="reverted"
+		;;
+	1c|hb|tcb|msnt|mstx|msr|msn|1csf|msns|mss)
+		main="perfbook-$1.tex"
+		change="modified"
+		;;
+	*)
+		echo "Unknown target!!"
+		exit 1
+		;;
+	esac
+fi
+
+tmpf=`mktemp`
+texfiles=`find . -name '*.tex' -print`
+modified=0
+for i in $texfiles
+do
+	c=$(expr `echo $i | grep -o "/" | wc -l` - 1)
+	x=
+	for j in $(seq 1 $c)
+	do
+		x=..\\/$x
+	done
+	mainpath=$x$main
+	pattern="s/% mainfile: .*perfbook.*\.tex/% mainfile: $mainpath/"
+	cat $i | sed -e "$pattern" > $tmpf
+	if ! diff -q $i $tmpf >/dev/null ; then
+		echo "$i $change."
+		cp -f $tmpf $i
+		modified=1
+	fi
+done
+
+if [ $modified -eq 0 ] ; then
+	echo "No modification."
+else
+	if [ $main != "perfbook.tex" -a $wasnotclean -eq 1 ] ; then
+		echo "### Git status was not clean."
+		echo "### To revert the changes, just run '$0'."
+	fi
+fi
+
+# check if synctex database exists
+mainbase="${main%.tex}"
+if [ `ls -1 perfbook* | grep -c $mainbase.synctex` -eq 0 ] ; then
+	echo "### $mainbase.synctex*: file not found."
+fi
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
  2019-10-22 11:17     ` [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files Akira Yokosawa
  2019-10-22 11:19     ` [PATCH v3 2/6] Add synctex-forward.sh Akira Yokosawa
@ 2019-10-22 11:21     ` Akira Yokosawa
  2019-10-22 11:22     ` [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support Akira Yokosawa
                       ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:21 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From 448d26cb10c9e31408431762302e299d655f7521 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 20 Oct 2019 14:09:21 +0900
Subject: [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 utilities/extractcontrib.sh | 1 +
 utilities/extractorigpub.sh | 1 +
 utilities/extractqqz.sh     | 1 +
 3 files changed, 3 insertions(+)

diff --git a/utilities/extractcontrib.sh b/utilities/extractcontrib.sh
index ae978ea0..8fc4b681 100644
--- a/utilities/extractcontrib.sh
+++ b/utilities/extractcontrib.sh
@@ -22,5 +22,6 @@
 #
 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
 
+echo "% mainfile: perfbook.tex"
 sed -n -e '/^\\ContributedBy{/p' |
 sed -e 's/^\\ContributedBy{/\\ContribItem{/'
diff --git a/utilities/extractorigpub.sh b/utilities/extractorigpub.sh
index 1fad230c..71154f96 100644
--- a/utilities/extractorigpub.sh
+++ b/utilities/extractorigpub.sh
@@ -22,6 +22,7 @@
 #
 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
 
+echo "% mainfile: perfbook.tex"
 sed -n -e '/^\\OriginallyPublished{/p' \
        -e '/^\\RangeOriginallyPublished{/p' |
 sed -e 's/^\\OriginallyPublished{/\\OrigPubItem{/' \
diff --git a/utilities/extractqqz.sh b/utilities/extractqqz.sh
index 921c78e8..5d54d31f 100644
--- a/utilities/extractqqz.sh
+++ b/utilities/extractqqz.sh
@@ -21,6 +21,7 @@
 #
 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
 
+echo "% mainfile: perfbook.tex"
 sed -n -e '/^\\QuickQuizChapter{/p' \
        -e '/^\\QuickQuiz{/,/^} \\QuickQuizEnd/p' |
 sed -e 's/^\\QuickQuizChapter{/\\QuickQAC{/' \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
                       ` (2 preceding siblings ...)
  2019-10-22 11:21     ` [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts Akira Yokosawa
@ 2019-10-22 11:22     ` Akira Yokosawa
  2019-10-22 11:23     ` [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
                       ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:22 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From b24d7992fef7dd5534b24465a4129071dcc5b556 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 20 Oct 2019 14:11:31 +0900
Subject: [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 FAQ-BUILD.txt                | 39 ++++++++++++++++++++++++++++++++++++
 utilities/synctex-forward.sh |  2 ++
 2 files changed, 41 insertions(+)

diff --git a/FAQ-BUILD.txt b/FAQ-BUILD.txt
index b3f04e67..4cab43b0 100644
--- a/FAQ-BUILD.txt
+++ b/FAQ-BUILD.txt
@@ -159,3 +159,42 @@
 
 	    2.	Install it by following instructions at:
 		https://help.ubuntu.com/community/LaTeX#Installing_packages_manually
+
+11.	Is it possible to generate SyncTeX database file?
+
+	A.	Yes, it is. Setting an environment variable:
+
+		    $ export LATEX_OPT="-synctex=1"
+
+		and doing "make clean; make" will generate
+		perfbook.synctex.gz. This will enable SyncTeX search
+		(.pdf <-> .tex) with a SyncTeX-supporting combination of
+		pdf viewer and editor.
+
+	    Notes:
+	      -	For an introduction of SyncTeX search (gedit <-> evince), see:
+
+		    https://help.gnome.org/users/evince/stable/index.html.en#synctex
+
+		Other combinations of SyncTeX-supporting viewers and editors
+		may work.
+
+	      - You need to install gedit-plugins and enable SyncTeX plugin
+		in gedit's preference.
+
+	      - You need to open one of LaTeX sources (e.g. perfbook.tex)
+		in gedit before doing inverse search from evince.
+
+	      - The environment variable LATEX_OPT works for other build
+		targets such as perfbook-1c.pdf, perfbook-hb.pdf, etc.
+		To enable forward search from gedit, run e.g.:
+
+		    $ utilities/synctex-forward.sh 1c
+
+	      - Changes made by utilities/synctex-forward.sh can be
+		reverted by running:
+
+		    $ utilitied/synctex-forward.sh
+
+		Please make sure to revert the changes before doing
+		"git commit" of the other updates you've made.
diff --git a/utilities/synctex-forward.sh b/utilities/synctex-forward.sh
index 312f9cc3..e08d87fa 100755
--- a/utilities/synctex-forward.sh
+++ b/utilities/synctex-forward.sh
@@ -21,6 +21,7 @@
 # If LATEX_OPT does not have "synctex", do nothing
 if ! echo $LATEX_OPT | grep -q synctex ; then
 	echo "LATEX_OPT has no synctex option. Exiting..."
+	echo "See #11 in FAQ-BUILD.txt for SyncTeX support."
 	exit 1
 fi
 
@@ -86,4 +87,5 @@ fi
 mainbase="${main%.tex}"
 if [ `ls -1 perfbook* | grep -c $mainbase.synctex` -eq 0 ] ; then
 	echo "### $mainbase.synctex*: file not found."
+	echo "### See #11 in FAQ-BUILD.txt for how to generate one."
 fi
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
                       ` (3 preceding siblings ...)
  2019-10-22 11:22     ` [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support Akira Yokosawa
@ 2019-10-22 11:23     ` Akira Yokosawa
  2019-10-22 11:24     ` [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout Akira Yokosawa
  2019-10-22 12:05     ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Paul E. McKenney
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:23 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From f4ecbf9683111d67e70fc32bfed737ac556bfaf5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 22 Oct 2019 12:53:00 +0900
Subject: [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme

This snippet was added using the verbatimbox scheme.
Convert it using VerbatimL.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 defer/rcuintro.tex | 56 ++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
index b9b9400e..000c61a7 100644
--- a/defer/rcuintro.tex
+++ b/defer/rcuintro.tex
@@ -370,49 +370,47 @@ has executed a context switch, which in turn guarantees that
 all pre-existing reader threads have completed.
 
 \begin{listing}[tbp]
-{ \scriptsize
-\begin{verbbox}[\LstLineNo]
+\begin{linelabel}[ln:defer:Insertion and Deletion With Concurrent Readers]
+\begin{VerbatimL}[commandchars=\\\[\]]
 struct route *gptr;
 
 int access_route(int (*f)(struct route *rp))
 {
-  int ret = -1;
-  struct route *rp;
-
-  rcu_read_lock();
-  rp = rcu_dereference(gptr);
-  if (rp)
-  	ret = f(rp);
-  rcu_read_unlock();
-  return ret;
+	int ret = -1;
+	struct route *rp;
+
+	rcu_read_lock();
+	rp = rcu_dereference(gptr);
+	if (rp)
+		ret = f(rp);
+	rcu_read_unlock();
+	return ret;
 }
 
 struct route *ins_route(struct route *rp)
 {
-  struct route *old_rp;
+	struct route *old_rp;
 
-  spin_lock(&route_lock);
-  old_rp = gptr;
-  rcu_assign_pointer(gptr, rp);
-  spin_unlock(&route_lock);
+	spin_lock(&route_lock);
+	old_rp = gptr;
+	rcu_assign_pointer(gptr, rp);
+	spin_unlock(&route_lock);
 }
 
 int del_route(void)
 {
-  struct route *old_rp;
-
-  spin_lock(&route_lock);
-  old_rp = gptr;
-  RCU_INIT_POINTER(gptr, NULL);
-  spin_unlock(&route_lock);
-  synchronize_rcu();
-  free(old_rp);
-  return !!old_rp;
+	struct route *old_rp;
+
+	spin_lock(&route_lock);
+	old_rp = gptr;
+	RCU_INIT_POINTER(gptr, NULL);
+	spin_unlock(&route_lock);
+	synchronize_rcu();
+	free(old_rp);
+	return !!old_rp;
 }
-\end{verbbox}
-}
-\centering
-\theverbbox
+\end{VerbatimL}
+\end{linelabel}
 \caption{Insertion and Deletion With Concurrent Readers}
 \label{lst:defer:Insertion and Deletion With Concurrent Readers}
 \end{listing}
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
                       ` (4 preceding siblings ...)
  2019-10-22 11:23     ` [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
@ 2019-10-22 11:24     ` Akira Yokosawa
  2019-10-22 12:05     ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Paul E. McKenney
  6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 11:24 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From cdc88c7afb93f5c9c867b474e3be14d8e9161657 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 22 Oct 2019 12:57:05 +0900
Subject: [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 defer/rcuapi.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/defer/rcuapi.tex b/defer/rcuapi.tex
index 47bb2da2..1c9d0365 100644
--- a/defer/rcuapi.tex
+++ b/defer/rcuapi.tex
@@ -26,7 +26,7 @@ presents concluding remarks.
 \centering
 \caption{RCU Wait-to-Finish APIs}
 \label{tab:defer:RCU Wait-to-Finish APIs}
-\footnotesize
+\footnotesize\OneColumnHSpace{-.9in}
 \begin{tabularx}{6.5in}{>{\raggedright\arraybackslash}p{1.08in}
     >{\raggedright\arraybackslash}X
     >{\raggedright\arraybackslash}X
@@ -423,7 +423,7 @@ that Linux supports~\cite{Spraul01}.
 \begin{table*}[tb]
 \renewcommand*{\arraystretch}{1.15}
 \footnotesize
-\centering
+\centering\OneColumnHSpace{-.4in}
 \begin{tabular}{llp{2.2in}}
 \toprule
 Category &
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search
  2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
                       ` (5 preceding siblings ...)
  2019-10-22 11:24     ` [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout Akira Yokosawa
@ 2019-10-22 12:05     ` Paul E. McKenney
  2019-10-22 14:34       ` [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
  6 siblings, 1 reply; 12+ messages in thread
From: Paul E. McKenney @ 2019-10-22 12:05 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook, Balbir Singh

On Tue, Oct 22, 2019 at 08:15:43PM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> Here is another attempt to enable SyncTeX forward search in perfbook.
> 
> This time, perfbook.synctex.gz will be generated only if you
> set the environment variable LATEX_OPT=-synctex=1. The behavior
> is not changed from current master.
> 
> I said in my reply to v2:
> 
>     ... this change does have regression in that the inverse search
>     (PDF -> .tex) stops working other than perfbook.pdf.
> 
> It tuned out this was my misconception. Inverse search works
> from other than perfbook.pdf with the "% mainfile: ...perfbook.tex"
> lines added to sub .tex files.
> 
> So, patch #1 adds the "mainfile:" tags (pointing perfbook.tex) in
> sub .tex files.
> Patch #2 adds a script to retarget the destination of forward search
> by modifying the "mainfile:" tags. It does nothing when LATEX_OPT
> has no "synctex" setting.  For the details of the script, please
> refer to the update of FAQ-BUILD.txt in patch #4.
> Patch #3 adds "mainfile:" lines in extracted .tex files (qqz.tex,
> origpub.tex, and contrib.tex).
> Patch #4 updates FAQ-BUILD.txt to mention SyncTeX support in
> perfbook.
> 
> Patches #5 and #6 update minor issues I noticed during the test
> of SyncTeX search with perfbook-1c.pdf.
> 
> I don't think gedit is your choice of editor, but SyncTeX surely
> helps in locating a particular .tex file you'd like to see.
> 
> Forward search is not complete in that it doesn't work in
> .fcv files. It looks like gedit's SyncTeX support is sensitive
> to suffix of .tex. I tried to add "mainfile" tags in .fcv files
> on the fly, but ended up in vain.  Inverse search to .fcv files
> works as expected.  There is a room of improvement to show where
> those .fcv files come from. I'll see what can be done.
> 
>         Thanks, Akira
> --
> Akira Yokosawa (6):
>   treewide: Add '% mainfile:' tags in headers in sub .tex files
>   Add synctex-forward.sh
>   Add output of '% mainfile: perfbook.tex' tags in extraction scripts
>   FAQ-BUILD: Mention how to enable SyncTeX support
>   defer/rcuintro: Convert snippet to new scheme

Very nice, applied and queued, thank you!

With the exception of defer/rcuintro.tex, which collided with one of
my cleanups.  I believe that the fix is straightforward, just accounting
for the line I added, but I figured that I should check.

							Thanx, Paul

>   defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout
> 
>  FAQ-BUILD.txt                             | 39 ++++++++++
>  SMPdesign/SMPdesign.tex                   |  2 +
>  SMPdesign/beyond.tex                      |  4 +-
>  SMPdesign/criteria.tex                    |  1 +
>  SMPdesign/partexercises.tex               |  2 +
>  advsync/advsync.tex                       |  2 +
>  advsync/rcu.tex                           |  2 +
>  advsync/rt.tex                            |  2 +
>  appendix/ack/ack.tex                      |  1 +
>  appendix/appendix.tex                     |  1 +
>  appendix/questions/after.tex              |  2 +
>  appendix/questions/concurrentparallel.tex |  1 +
>  appendix/questions/questions.tex          |  1 +
>  appendix/questions/time.tex               |  1 +
>  appendix/styleguide/styleguide.tex        |  1 +
>  appendix/toyrcu/toyrcu.tex                |  2 +
>  appendix/whymb/whymemorybarriers.tex      |  2 +
>  count/count.tex                           |  2 +
>  cpu/cpu.tex                               |  1 +
>  cpu/hwfreelunch.tex                       |  1 +
>  cpu/overheads.tex                         |  1 +
>  cpu/overview.tex                          |  2 +
>  cpu/swdesign.tex                          |  1 +
>  datastruct/datastruct.tex                 |  2 +
>  debugging/debugging.tex                   |  2 +
>  defer/defer.tex                           |  1 +
>  defer/hazptr.tex                          |  1 +
>  defer/rcu.tex                             |  3 +-
>  defer/rcuapi.tex                          |  6 +-
>  defer/rcuexercises.tex                    |  1 +
>  defer/rcufundamental.tex                  |  2 +
>  defer/rcuintro.tex                        | 58 +++++++--------
>  defer/rcurelated.tex                      |  2 +
>  defer/rcuusage.tex                        |  2 +
>  defer/refcnt.tex                          |  2 +
>  defer/seqlock.tex                         |  2 +
>  defer/updates.tex                         |  3 +-
>  defer/whichtochoose.tex                   |  1 +
>  easy/easy.tex                             |  1 +
>  formal/axiomatic.tex                      |  2 +
>  formal/dyntickrcu.tex                     |  2 +
>  formal/formal.tex                         |  1 +
>  formal/ppcmem.tex                         |  4 +-
>  formal/sat.tex                            |  1 +
>  formal/spinhint.tex                       |  2 +
>  formal/stateless.tex                      |  1 +
>  future/cpu.tex                            |  1 +
>  future/formalregress.tex                  |  1 +
>  future/future.tex                         |  1 +
>  future/htm.tex                            |  2 +
>  future/tm.tex                             |  2 +
>  glossary.tex                              |  1 +
>  howto/howto.tex                           |  2 +
>  intro/intro.tex                           |  1 +
>  legal.tex                                 |  1 +
>  locking/locking-existence.tex             |  4 +-
>  locking/locking.tex                       |  2 +
>  memalloc/memalloc.tex                     |  1 +
>  memorder/memorder.tex                     |  2 +
>  owned/owned.tex                           |  2 +
>  together/applyrcu.tex                     |  2 +
>  together/count.tex                        |  1 +
>  together/hash.tex                         |  1 +
>  together/refcnt.tex                       |  2 +
>  together/together.tex                     |  1 +
>  toolsoftrade/toolsoftrade.tex             |  2 +
>  utilities/extractcontrib.sh               |  1 +
>  utilities/extractorigpub.sh               |  1 +
>  utilities/extractqqz.sh                   |  1 +
>  utilities/synctex-forward.sh              | 91 +++++++++++++++++++++++
>  70 files changed, 266 insertions(+), 36 deletions(-)
>  create mode 100755 utilities/synctex-forward.sh
> 
> -- 
> 2.17.1
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme
  2019-10-22 12:05     ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Paul E. McKenney
@ 2019-10-22 14:34       ` Akira Yokosawa
  2019-10-22 15:51         ` Paul E. McKenney
  0 siblings, 1 reply; 12+ messages in thread
From: Akira Yokosawa @ 2019-10-22 14:34 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Balbir Singh

From 6a9e5e96a0dd94b6f20052ab741d2606e79dc80f Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Tue, 22 Oct 2019 23:23:42 +0900
Subject: [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme

This snippet was added using the verbatimbox scheme.
Convert it using VerbatimL.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi Paul,

> With the exception of defer/rcuintro.tex, which collided with one of
> my cleanups.  I believe that the fix is straightforward, just accounting
> for the line I added, but I figured that I should check.

FWIW, this is the result of my rebase of the patch.

        Thanks, Akira
> 
> 							Thanx, Paul

--
 defer/rcuintro.tex | 58 ++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 30 deletions(-)

diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
index ed7ff0b0..dc750326 100644
--- a/defer/rcuintro.tex
+++ b/defer/rcuintro.tex
@@ -375,50 +375,48 @@ has executed a context switch, which in turn guarantees that
 all pre-existing reader threads have completed.
 
 \begin{listing}[tbp]
-{ \scriptsize
-\begin{verbbox}[\LstLineNo]
+\begin{linelabel}[ln:defer:Insertion and Deletion With Concurrent Readers]
+\begin{VerbatimL}[commandchars=\\\[\]]
 struct route *gptr;
 
 int access_route(int (*f)(struct route *rp))
 {
-  int ret = -1;
-  struct route *rp;
-
-  rcu_read_lock();
-  rp = rcu_dereference(gptr);
-  if (rp)
-  	ret = f(rp);
-  rcu_read_unlock();
-  return ret;
+	int ret = -1;
+	struct route *rp;
+
+	rcu_read_lock();
+	rp = rcu_dereference(gptr);
+	if (rp)
+		ret = f(rp);
+	rcu_read_unlock();
+	return ret;
 }
 
 struct route *ins_route(struct route *rp)
 {
-  struct route *old_rp;
+	struct route *old_rp;
 
-  spin_lock(&route_lock);
-  old_rp = gptr;
-  rcu_assign_pointer(gptr, rp);
-  spin_unlock(&route_lock);
-  return old_rp;
+	spin_lock(&route_lock);
+	old_rp = gptr;
+	rcu_assign_pointer(gptr, rp);
+	spin_unlock(&route_lock);
+	return old_rp;
 }
 
 int del_route(void)
 {
-  struct route *old_rp;
-
-  spin_lock(&route_lock);
-  old_rp = gptr;
-  RCU_INIT_POINTER(gptr, NULL);
-  spin_unlock(&route_lock);
-  synchronize_rcu();
-  free(old_rp);
-  return !!old_rp;
+	struct route *old_rp;
+
+	spin_lock(&route_lock);
+	old_rp = gptr;
+	RCU_INIT_POINTER(gptr, NULL);
+	spin_unlock(&route_lock);
+	synchronize_rcu();
+	free(old_rp);
+	return !!old_rp;
 }
-\end{verbbox}
-}
-\centering
-\theverbbox
+\end{VerbatimL}
+\end{linelabel}
 \caption{Insertion and Deletion With Concurrent Readers}
 \label{lst:defer:Insertion and Deletion With Concurrent Readers}
 \end{listing}
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme
  2019-10-22 14:34       ` [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
@ 2019-10-22 15:51         ` Paul E. McKenney
  0 siblings, 0 replies; 12+ messages in thread
From: Paul E. McKenney @ 2019-10-22 15:51 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook, Balbir Singh

On Tue, Oct 22, 2019 at 11:34:48PM +0900, Akira Yokosawa wrote:
> >From 6a9e5e96a0dd94b6f20052ab741d2606e79dc80f Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Tue, 22 Oct 2019 23:23:42 +0900
> Subject: [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme
> 
> This snippet was added using the verbatimbox scheme.
> Convert it using VerbatimL.
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Hi Paul,
> 
> > With the exception of defer/rcuintro.tex, which collided with one of
> > my cleanups.  I believe that the fix is straightforward, just accounting
> > for the line I added, but I figured that I should check.
> 
> FWIW, this is the result of my rebase of the patch.

Queued and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> > 
> > 							Thanx, Paul
> 
> --
>  defer/rcuintro.tex | 58 ++++++++++++++++++++++------------------------
>  1 file changed, 28 insertions(+), 30 deletions(-)
> 
> diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
> index ed7ff0b0..dc750326 100644
> --- a/defer/rcuintro.tex
> +++ b/defer/rcuintro.tex
> @@ -375,50 +375,48 @@ has executed a context switch, which in turn guarantees that
>  all pre-existing reader threads have completed.
>  
>  \begin{listing}[tbp]
> -{ \scriptsize
> -\begin{verbbox}[\LstLineNo]
> +\begin{linelabel}[ln:defer:Insertion and Deletion With Concurrent Readers]
> +\begin{VerbatimL}[commandchars=\\\[\]]
>  struct route *gptr;
>  
>  int access_route(int (*f)(struct route *rp))
>  {
> -  int ret = -1;
> -  struct route *rp;
> -
> -  rcu_read_lock();
> -  rp = rcu_dereference(gptr);
> -  if (rp)
> -  	ret = f(rp);
> -  rcu_read_unlock();
> -  return ret;
> +	int ret = -1;
> +	struct route *rp;
> +
> +	rcu_read_lock();
> +	rp = rcu_dereference(gptr);
> +	if (rp)
> +		ret = f(rp);
> +	rcu_read_unlock();
> +	return ret;
>  }
>  
>  struct route *ins_route(struct route *rp)
>  {
> -  struct route *old_rp;
> +	struct route *old_rp;
>  
> -  spin_lock(&route_lock);
> -  old_rp = gptr;
> -  rcu_assign_pointer(gptr, rp);
> -  spin_unlock(&route_lock);
> -  return old_rp;
> +	spin_lock(&route_lock);
> +	old_rp = gptr;
> +	rcu_assign_pointer(gptr, rp);
> +	spin_unlock(&route_lock);
> +	return old_rp;
>  }
>  
>  int del_route(void)
>  {
> -  struct route *old_rp;
> -
> -  spin_lock(&route_lock);
> -  old_rp = gptr;
> -  RCU_INIT_POINTER(gptr, NULL);
> -  spin_unlock(&route_lock);
> -  synchronize_rcu();
> -  free(old_rp);
> -  return !!old_rp;
> +	struct route *old_rp;
> +
> +	spin_lock(&route_lock);
> +	old_rp = gptr;
> +	RCU_INIT_POINTER(gptr, NULL);
> +	spin_unlock(&route_lock);
> +	synchronize_rcu();
> +	free(old_rp);
> +	return !!old_rp;
>  }
> -\end{verbbox}
> -}
> -\centering
> -\theverbbox
> +\end{VerbatimL}
> +\end{linelabel}
>  \caption{Insertion and Deletion With Concurrent Readers}
>  \label{lst:defer:Insertion and Deletion With Concurrent Readers}
>  \end{listing}
> -- 
> 2.17.1
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-10-22 15:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fac2cbbb-492c-acde-14a8-15ee04b95ea9@gmail.com>
     [not found] ` <2d2eb3d6-d050-6f0c-aca5-b0cc76e8e0ec@gmail.com>
2019-10-19 11:43   ` [PATCH v2] Always generate perfbook.synctex.gz Akira Yokosawa
2019-10-19 15:35     ` Paul E. McKenney
2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
2019-10-22 11:17     ` [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files Akira Yokosawa
2019-10-22 11:19     ` [PATCH v3 2/6] Add synctex-forward.sh Akira Yokosawa
2019-10-22 11:21     ` [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts Akira Yokosawa
2019-10-22 11:22     ` [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support Akira Yokosawa
2019-10-22 11:23     ` [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
2019-10-22 11:24     ` [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout Akira Yokosawa
2019-10-22 12:05     ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Paul E. McKenney
2019-10-22 14:34       ` [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
2019-10-22 15:51         ` Paul E. McKenney

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.