slab: Explain why SLAB_TYPESAFE_BY_RCU reference before locking
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 26 Sep 2022 15:57:56 +0000 (08:57 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Oct 2022 17:08:43 +0000 (10:08 -0700)
commite9f8a790bf682bb4a2f79d0d905b34d55bceb71d
tree98bc145b5a7058418583d51108c55d08b109eca2
parentaba9645bd10bd9f793732b06495b1312ee44865e
slab: Explain why SLAB_TYPESAFE_BY_RCU reference before locking

It is not obvious to the casual user why it is absolutely necessary to
acquire a reference to a SLAB_TYPESAFE_BY_RCU structure before acquiring
a lock in that structure.  Therefore, add a comment explaining this point.

[ paulmck: Apply Vlastimil Babka feedback. ]

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: <linux-mm@kvack.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
include/linux/slab.h