From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.ibm.com>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH 4/6] datastruct/hash: Adjust context to updated code in hash_resize.c
Date: Mon, 14 Jan 2019 08:35:07 +0900 [thread overview]
Message-ID: <c3a15056-e212-b94e-c53f-e9512c1f594a@gmail.com> (raw)
In-Reply-To: <dff55e7c-6e93-8f4a-79fd-f400ed3b38f8@gmail.com>
From fd50eec2691a61abd52b038c750e173ab1160b02 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 13 Jan 2019 20:00:20 +0900
Subject: [PATCH 4/6] datastruct/hash: Adjust context to updated code in hash_resize.c
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
datastruct/datastruct.tex | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/datastruct/datastruct.tex b/datastruct/datastruct.tex
index f344842..6d8350a 100644
--- a/datastruct/datastruct.tex
+++ b/datastruct/datastruct.tex
@@ -952,7 +952,7 @@ In contrast, when resizing, it is also necessary to determine which
of the old and new sets of buckets to select from.
If the bucket that would be selected from the old table has already
been distributed into the new table, then the bucket should be selected
-from the new table.
+from the new table as well as from the old table.
Conversely, if the bucket that would be selected from the old table
has not yet been distributed, then the bucket should be selected from
the old table.
@@ -1073,15 +1073,14 @@ section.
\QuickQuiz{}
Suppose that one thread is inserting an element into the
- new hash table during a resize operation.
+ hash table during a resize operation.
What prevents this insertion from being lost due to a subsequent
resize operation completing before the insertion does?
\QuickQuizAnswer{
The second resize operation will not be able to move beyond
the bucket into which the insertion is taking place due to
- the insertion holding the lock on one of the hash buckets in
- the new hash table (the second hash table of three in this
- example).
+ the insertion holding the lock(s) on one or both of the hash
+ buckets in the hash tables.
Furthermore, the insertion operation takes place within an
RCU read-side critical section.
As we will see when we examine the \co{hashtab_resize()}
--
2.7.4
next prev parent reply other threads:[~2019-01-13 23:35 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
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 ` Akira Yokosawa [this message]
2019-01-13 23:36 ` [PATCH 5/6] datastruct/hash: Add Quick Quiz on READ_ONCE/WRITE_ONCE in hash_resize.c 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=c3a15056-e212-b94e-c53f-e9512c1f594a@gmail.com \
--to=akiyks@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.