All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Junchang Wang <junchangwang@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>,
	perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH 1/6] datastruct/hash: Simplify hash_resize.c
Date: Mon, 14 Jan 2019 22:22:25 +0900	[thread overview]
Message-ID: <ca2ea462-1e4a-7361-d2f5-48dc7165bdca@gmail.com> (raw)
In-Reply-To: <CABoNC83-CFLuHzFurZG6UT=tJFDMzYxGZr-+MrkDPtcCgETa2w@mail.gmail.com>

Hi Junchang, 

On 2019/01/14 18:31:21 +0800, Junchang Wang wrote:
> FCV_SNIPPET" blocks are used to hide
> code for debugging
> 
> On Mon, Jan 14, 2019 at 7:31 AM Akira Yokosawa <akiyks@gmail.com> wrote:
>>
>> From 1ffe7edfb90cbb8efb2a33d2ae8c3e855e684acf Mon Sep 17 00:00:00 2001
>> From: Akira Yokosawa <akiyks@gmail.com>
>> Date: Sun, 13 Jan 2019 19:47:23 +0900
>> Subject: [PATCH 1/6] datastruct/hash: Simplify hash_resize.c
>>
>> By keeping updating the current (old) hash table until resizing
>> completes, hashtab_lookup() only needs to see the current hash table.
>> Instead, hashtab_add() and hashtab_del() need to update the bucket in
>> the current hash table as well as that in the new hash table if
>> hashtab_lock_mod() has locked the new bucket.
>>
>> This simplifies the lookup side and no performance degradation
>> is expected as long as no resizing is in progress.
>>
>> Note that during resize operation, the cost of updates can be
>> doubled in the worst case.
>>
>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>> ---
>>  CodeSamples/datastruct/hash/hash_resize.c | 56 ++++++++++++++-----------
>>  CodeSamples/datastruct/hash/hashtorture.h |  6 ++-
>>  datastruct/datastruct.tex                 | 69 ++++++++++---------------------
>>  3 files changed, 59 insertions(+), 72 deletions(-)
>>
>> diff --git a/CodeSamples/datastruct/hash/hash_resize.c b/CodeSamples/datastruct/hash/hash_resize.c
>> index 9f9fe8c..e475910 100644
>> --- a/CodeSamples/datastruct/hash/hash_resize.c
>> +++ b/CodeSamples/datastruct/hash/hash_resize.c
>> @@ -30,7 +30,9 @@
>>  struct ht_elem {
>>         struct rcu_head rh;
>>         struct cds_list_head hte_next[2];               //\lnlbl{ht_elem:next}
>> -       unsigned long hte_hash;
>> +#ifndef FCV_SNIPPET
>> +       unsigned long hte_hash[2];
>> +#endif /* #ifndef FCV_SNIPPET */
> 
> Hi Akira,
> 
> I understand that the micro FCV_SNIPPET is used to hide code for
> checking hash value in this patch set. I just curious about the exact
> meaning of the term FCV_SNIPPET itself. Specifically, what does the
> acronym FCV stand for? I encountered it multiple times while checking
> the code of perfbook, but didn't find any documentation.

Brief documentation is given in the header of utilities/fcvextract.pl.
"FCV" came from a LaTeX package name "fancyvrb".
The macro FCV_SNIPPET is not supposed to be actually defined.
In this particular case, defining it can eliminate the code
to check hash values.

Does this short answer make sense to you?

To add explanation of FCV_SNIPPET and other new features of
fcvextract.pl in the style guide is on my to-do list.

        Thanks, Akira

> 
> Thanks,
> --Junchang
> 
> 
[...]


  reply	other threads:[~2019-01-14 13:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-13 23:28 [PATCH 0/6] Simplify hash_resize.c Akira Yokosawa
2019-01-13 23:31 ` [PATCH 1/6] datastruct/hash: " Akira Yokosawa
2019-01-14 10:31   ` Junchang Wang
2019-01-14 13:22     ` Akira Yokosawa [this message]
2019-01-14 14:16       ` Junchang Wang
2019-01-13 23:32 ` [PATCH 2/6] datastruct/hash: Add a couple of Quick Quizzes regarding hash_resize.c Akira Yokosawa
2019-01-13 23:33 ` [PATCH 3/6] datastruct/hash: Fix unnecessary folding in code snippet Akira Yokosawa
2019-01-13 23:35 ` [PATCH 4/6] datastruct/hash: Adjust context to updated code in hash_resize.c Akira Yokosawa
2019-01-13 23:36 ` [PATCH 5/6] datastruct/hash: Add Quick Quiz on READ_ONCE/WRITE_ONCE " Akira Yokosawa
2019-01-13 23:38 ` [PATCH 6/6] datastruct/hash: Display error msg if rcu_barrier() is not available Akira Yokosawa
2019-01-14  2:10 ` [PATCH 0/6] Simplify hash_resize.c Paul E. McKenney
2019-01-15  1:33   ` Paul E. McKenney
2019-01-15 15:32     ` Akira Yokosawa
2019-01-15 17:43       ` Paul E. McKenney
2019-01-15 22:15         ` Akira Yokosawa
2019-01-16  0:06           ` Paul E. McKenney
2019-01-15 22:29   ` Akira Yokosawa
2019-01-16  0:07     ` 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=ca2ea462-1e4a-7361-d2f5-48dc7165bdca@gmail.com \
    --to=akiyks@gmail.com \
    --cc=junchangwang@gmail.com \
    --cc=paulmck@linux.ibm.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.