projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rcuja: Add debug output
[userspace-rcu.git]
/
rcuja
/
rcuja.c
diff --git
a/rcuja/rcuja.c
b/rcuja/rcuja.c
index bb0393c0fc9c703a9e97ca9aeb1cfb7eeeab65de..db5072a2133f469672c2010df73e2485e09f2a57 100644
(file)
--- a/
rcuja/rcuja.c
+++ b/
rcuja/rcuja.c
@@
-805,7
+805,7
@@
retry: /* for fallback */
}
skip_copy:
}
skip_copy:
- if (JA_RECOMPACT_ADD) {
+ if (
mode ==
JA_RECOMPACT_ADD) {
/* add node */
ret = _ja_node_set_nth(new_type, new_node,
new_shadow_node,
/* add node */
ret = _ja_node_set_nth(new_type, new_node,
new_shadow_node,
@@
-1279,19
+1279,25
@@
end:
static
int ja_unchain_node(struct cds_ja *ja,
struct cds_ja_inode_flag *parent_node_flag,
static
int ja_unchain_node(struct cds_ja *ja,
struct cds_ja_inode_flag *parent_node_flag,
+ struct cds_hlist_head *head,
struct cds_ja_node *node)
{
struct cds_ja_shadow_node *shadow_node;
struct cds_ja_node *node)
{
struct cds_ja_shadow_node *shadow_node;
- int ret = 0;
+ struct cds_hlist_node *hlist_node;
+ int ret = 0, count = 0;
shadow_node = rcuja_shadow_lookup_lock(ja->ht, parent_node_flag);
if (!shadow_node)
return -EAGAIN;
/*
* Retry if another thread removed all but one of duplicates
shadow_node = rcuja_shadow_lookup_lock(ja->ht, parent_node_flag);
if (!shadow_node)
return -EAGAIN;
/*
* Retry if another thread removed all but one of duplicates
- * since check.
+ * since check
(that was performed without lock)
.
*/
*/
- if (shadow_node->nr_child == 1) {
+ cds_hlist_for_each_rcu(hlist_node, head, list) {
+ count++;
+ }
+
+ if (count == 1) {
ret = -EAGAIN;
goto end;
}
ret = -EAGAIN;
goto end;
}
@@
-1394,7
+1400,8
@@
retry:
ret = ja_detach_node(ja, snapshot, snapshot_ptr,
snapshot_n, nr_snapshot, key, node);
} else {
ret = ja_detach_node(ja, snapshot, snapshot_ptr,
snapshot_n, nr_snapshot, key, node);
} else {
- ret = ja_unchain_node(ja, node_flag, entry);
+ ret = ja_unchain_node(ja, snapshot[nr_snapshot - 1],
+ &hlist_head, match);
}
}
if (ret == -EAGAIN)
}
}
if (ret == -EAGAIN)
@@
-1415,13
+1422,13
@@
struct cds_ja *_cds_ja_new(unsigned int key_bits,
switch (key_bits) {
case 8:
switch (key_bits) {
case 8:
- ja->key_max = UINT8_MAX;
- break;
case 16:
case 16:
- ja->key_max = UINT16_MAX;
- break;
+ case 24:
case 32:
case 32:
- ja->key_max = UINT32_MAX;
+ case 40:
+ case 48:
+ case 56:
+ ja->key_max = (1ULL << key_bits) - 1;
break;
case 64:
ja->key_max = UINT64_MAX;
break;
case 64:
ja->key_max = UINT64_MAX;
This page took
0.038842 seconds
and
4
git commands to generate.