lkml.org 
[lkml]   [2022]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH rcu 5/8] slab: Explain why SLAB_DESTROY_BY_RCU reference before locking
On Wed, 19 Oct 2022, Paul E. McKenney wrote:

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

Sorry but this is not correct and difficult to comprehend.

1. You do not need a reference to a slab object after it was allocated.
Objects must be properly protected by rcu_locks.

2. Locks are initialized once on slab allocation via a constructor (*not* on object allocation via kmem_cache_alloc)

3. Modifying locks at allocation/free is not possible since references to
these objects may still persist after free and before alloc.

4. The old term SLAB_DESTROY_BY_RCU is used here.

\
 
 \ /
  Last update: 2022-10-21 09:53    [W:0.072 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site