diff options
author | NeilBrown <neilb@suse.com> | 2019-04-02 02:07:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-08 05:12:12 +0300 |
commit | 7a41c294c1463100fdc82a356e22e36bbaa6b0f9 (patch) | |
tree | 136016cd26613f78f0c47d1d477eef9ac84061c3 /lib/fdt.c | |
parent | 1e045a62eea6a60f0463b01f72256a5ba483da1c (diff) | |
download | linux-7a41c294c1463100fdc82a356e22e36bbaa6b0f9.tar.xz |
rhashtable: use cmpxchg() in nested_table_alloc()
nested_table_alloc() relies on the fact that there is
at most one spinlock allocated for every slot in the top
level nested table, so it is not possible for two threads
to try to allocate the same table at the same time.
This assumption is a little fragile (it is not explicit) and is
unnecessary as cmpxchg() can be used instead.
A future patch will replace the spinlocks by per-bucket bitlocks,
and then we won't be able to protect the slot pointer with a spinlock.
So replace rcu_assign_pointer() with cmpxchg() - which has equivalent
barrier properties.
If it the cmp fails, free the table that was just allocated.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/fdt.c')
0 files changed, 0 insertions, 0 deletions