Thread (5 messages) 5 messages, 5 authors, 2015-09-23

Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one

flat view

From: David Miller <davem@davemloft.net>
Date: 2015-09-23 00:36:31
Also in: lkml

From: Dmitry Vyukov <dvyukov@google.com>
Date: Tue, 22 Sep 2015 10:51:52 +0200
rhashtable_rehash_one() uses complex logic to update entry->next field,
after INIT_RHT_NULLS_HEAD and NULLS_MARKER expansion:

entry->next = 1 | ((base + off) << 1)

This can be compiled along the lines of:

entry->next = base + off
entry->next <<= 1
entry->next |= 1

Which will break concurrent readers.

NULLS value recomputation is not needed here, so just remove
the complex logic.

The data race was found with KernelThreadSanitizer (KTSAN).

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help