From: Thomas Graf <tgraf@suug.ch>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kcc@google.com,
andreyknvl@google.com, glider@google.com, ktsan@googlegroups.com,
paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one
Date: Tue, 22 Sep 2015 11:17:38 +0200 [thread overview]
Message-ID: <20150922091738.GD13047@pox.localdomain> (raw)
In-Reply-To: <1442911912-66882-1-git-send-email-dvyukov@google.com>
On 09/22/15 at 10:51am, Dmitry Vyukov wrote:
> 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>
Acked-by: Thomas Graf <tgraf@suug.ch>
next prev parent reply other threads:[~2015-09-22 9:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 8:51 [PATCH v2] lib: fix data race in rhashtable_rehash_one Dmitry Vyukov
2015-09-22 9:05 ` Eric Dumazet
2015-09-22 9:17 ` Thomas Graf [this message]
2015-09-22 15:19 ` Herbert Xu
2015-09-23 0:36 ` David Miller
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=20150922091738.GD13047@pox.localdomain \
--to=tgraf@suug.ch \
--cc=andreyknvl@google.com \
--cc=dvyukov@google.com \
--cc=eric.dumazet@gmail.com \
--cc=glider@google.com \
--cc=kcc@google.com \
--cc=ktsan@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).