[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1547146287.83374.49.camel@acm.org>
Date: Thu, 10 Jan 2019 10:51:27 -0800
From: Bart Van Assche <bvanassche@....org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, tj@...nel.org, longman@...hat.com,
johannes.berg@...el.com, linux-kernel@...r.kernel.org,
Johannes Berg <johannes@...solutions.net>
Subject: Re: [PATCH v5 07/15] locking/lockdep: Free lock classes that are no
longer in use
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.
Powered by blists - more mailing lists