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

2015-09-22 Thread David Miller
From: Dmitry Vyukov 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 = b

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

2015-09-22 Thread Herbert Xu
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-

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

2015-09-22 Thread Thomas Graf
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 > ent

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

2015-09-22 Thread Eric Dumazet
On Tue, 2015-09-22 at 10:51 +0200, 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

[PATCH v2] lib: fix data race in rhashtable_rehash_one

2015-09-22 Thread Dmitry Vyukov
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 re