lkml.org 
[lkml]   [2019]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 07/15] locking/lockdep: Free lock classes that are no longer in use
From
Date
On Thu, 2019-01-10 at 16:24 +0100, Peter Zijlstra wrote:
> /*
> * A data structure for delayed freeing of data structures that may be
> - * accessed by RCU readers at the time these were freed. The size of the array
> - * is a compromise between minimizing the amount of memory used by this array
> - * and minimizing the number of wait_event() calls by get_pending_free_lock().
> + * accessed by RCU readers at the time these were freed.
> */
> static struct pending_free {
> - struct list_head zapped_classes;
> struct rcu_head rcu_head;
> + int index;
> int pending;
> -} pending_free[2];
> -static DECLARE_WAIT_QUEUE_HEAD(rcu_cb);
> + struct list_head zapped[2];
> +} pending_free;

Hi Peter,

If the zapped[] array only has two elements there is no guarantee that an
element will be free when zap_class() is called. I think we need at least
num_online_cpus() elements to guarantee that at least one element is free
when zap_class() is called. So removing the wait loop from
get_pending_free_lock() seems wrong to me. Have you tried to run a workload
that keeps all CPUs busy and that triggers get_pending_free_lock()
frequently?

Thanks,

Bart.


\
 
 \ /
  Last update: 2019-01-10 19:52    [W:0.102 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site