From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: [PATCH] datastruct/hash: Tweak appearance of updated code in snippet
Date: Thu, 3 Jan 2019 09:21:45 -0800 [thread overview]
Message-ID: <20190103172145.GG4170@linux.ibm.com> (raw)
In-Reply-To: <a9847c9c-a7ca-5bf7-6936-7a68203c4fd2@gmail.com>
On Fri, Jan 04, 2019 at 12:57:06AM +0900, Akira Yokosawa wrote:
> >From ae50debbf06ad674e4941b55764b02c776484509 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Fri, 4 Jan 2019 00:19:26 +0900
> Subject: [PATCH] datastruct/hash: Tweak appearance of updated code in snippet
>
> Now that "[" and "]" are used within the code, "commandchars" should
> avoid them.
>
> Also wrap a line which has become too wide for the 2c layout.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Ah, the lsp[2] was a temporary state. I forgot to do a final "git push"
yesterday, apologies!
> ---
> Hi Paul,
>
> I'm in the middle of reading the updated code.
>
> I'm sure you are working on the update of Section 10.4.2.
> Because of the code change, there are quite a few broken refs
> and duplicated labels at the moment.
Yes, it is a bit of a mess at this point. I figured that if I was
going to have to modify the text and labels, I might as well do the
extra work to make the API a little less obnoxious. My first attempt to
move hash_resize.c's hashtab_add() in this direction broke very badly,
so it is back to the drawing board.
I am thinking in terms of having a single struct ht_lock_state that
contains an array or two as one part of making the API less obnoxious,
which should help avoid the brokenness.
> This commit just takes care of the vanishing "[" and "]" in
> Listing 10.11.
I am hoping that we can retain "[" and "]" -- it is normally not such
a good idea to have arrays in parameter lists.
Or do we need this commit anyway just due to array references within
the code snippet? If the latter, I will hand-apply the patch.
> Fixing labels is left for your update.
Will do, and yes, they are a bit of a mess just now. ;-)
Thanx, Paul
> Thanks, Akira
> --
> CodeSamples/datastruct/hash/hash_resize.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/CodeSamples/datastruct/hash/hash_resize.c b/CodeSamples/datastruct/hash/hash_resize.c
> index bb0a6f4..7392455 100644
> --- a/CodeSamples/datastruct/hash/hash_resize.c
> +++ b/CodeSamples/datastruct/hash/hash_resize.c
> @@ -154,10 +154,11 @@ static void hashtab_unlock_lookup(struct hashtab *htp_master, void *key)
> rcu_read_unlock();
> }
>
> -//\begin{snippet}[labelbase=ln:datastruct:hash_resize:lock_unlock_mod,commandchars=\\\[\]]
> +//\begin{snippet}[labelbase=ln:datastruct:hash_resize:lock_unlock_mod,commandchars=\\\@\$]
> /* Update-side lock/unlock functions. */
> static void //\lnlbl{lock:b}
> -resize_lock_mod(struct hashtab *htp_master, void *key, struct ht_bucket *ls[2])
> +resize_lock_mod(struct hashtab *htp_master, void *key,
> + struct ht_bucket *ls[2])
> {
> long b;
> struct ht *htp;
> --
> 2.7.4
>
>
next prev parent reply other threads:[~2019-01-03 17:21 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-24 14:46 [PATCH 00/11] datastruct: Employ new scheme for code snippet Akira Yokosawa
2018-12-24 14:53 ` [PATCH 01/11] fcvextract.pl: Enhance comment block handling of C source Akira Yokosawa
2018-12-24 14:55 ` [PATCH 02/11] CodeSamples: Add explicit 'keepcomment=yes' options Akira Yokosawa
2018-12-24 14:56 ` [PATCH 03/11] fcvextract.pl: Make 'keepcomment=no' as default Akira Yokosawa
2018-12-24 14:57 ` [PATCH 04/11] CodeSamples: Remove redundant \fcvexclude Akira Yokosawa
2018-12-24 14:59 ` [PATCH 05/11] fcvextract.pl: Support '/* \lnlbl{...} */' style label in C source Akira Yokosawa
2018-12-24 15:00 ` [PATCH 06/11] datastruct: Employ new scheme for snippets of hash_bkt.c Akira Yokosawa
2018-12-24 15:01 ` [PATCH 07/11] datastruct: Update hashdiagram figure Akira Yokosawa
2018-12-24 15:02 ` [PATCH 08/11] datastruct: Employ new scheme for snippets of hash_bkt_rcu and hash_resize Akira Yokosawa
2018-12-24 15:03 ` [PATCH 09/11] Make sure lmtt font is used in 'VerbatimL' and 'Verbatim' env Akira Yokosawa
2018-12-24 15:04 ` [PATCH 10/11] Use wider tabsize for snippet in 'listing*' Akira Yokosawa
2018-12-24 15:05 ` [PATCH 11/11] datastruct: Tweak hyphenation Akira Yokosawa
2018-12-24 23:58 ` [PATCH 00/11] datastruct: Employ new scheme for code snippet Paul E. McKenney
2018-12-25 0:53 ` Paul E. McKenney
2018-12-25 14:30 ` Akira Yokosawa
2018-12-26 14:17 ` Paul E. McKenney
2018-12-26 14:31 ` [PATCH] gen_snippet_d.pl: Add rules to ignore editor's backup files Akira Yokosawa
2018-12-26 15:00 ` Paul E. McKenney
2018-12-31 4:37 ` Sporadic SIGSEGV in hash_bkt_rcu and hash_resize (was Re: [PATCH] gen_snippet_d.pl: Add rules to ignore editor's backup files) Akira Yokosawa
2018-12-31 15:15 ` [PATCH] EXP hashtorture.h: Avoid sporadic SIGSEGV in hash_bkt_rcu Akira Yokosawa
2018-12-31 21:03 ` Paul E. McKenney
2019-01-01 0:27 ` Akira Yokosawa
2019-01-01 18:00 ` Paul E. McKenney
2019-01-02 15:02 ` Akira Yokosawa
2019-01-02 17:18 ` Paul E. McKenney
2019-01-02 19:18 ` Paul E. McKenney
2019-01-03 15:57 ` [PATCH] datastruct/hash: Tweak appearance of updated code in snippet Akira Yokosawa
2019-01-03 17:21 ` Paul E. McKenney [this message]
2019-01-03 23:35 ` Akira Yokosawa
2019-01-04 0:52 ` Paul E. McKenney
2019-01-04 1:56 ` Akira Yokosawa
2019-01-04 3:56 ` Paul E. McKenney
2019-01-04 15:38 ` Akira Yokosawa
2019-01-04 15:39 ` [PATCH 1/2] datastruct/hash: Tweak indent of folded line " Akira Yokosawa
2019-01-04 22:40 ` Paul E. McKenney
2019-01-04 15:41 ` [PATCH 2/2] datastruct/hash: Annotate racy accesses with READ_ONCE/WRITE_ONCE Akira Yokosawa
2019-01-05 0:10 ` Paul E. McKenney
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=20190103172145.GG4170@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=akiyks@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox