Re: [PATCH v2 7/9] locking/rwlocks: introduce write_lock_nested
From: Peter Zijlstra
Date: Tue Nov 16 2021 - 05:28:14 EST
On Mon, Nov 15, 2021 at 10:59:07AM -0800, Minchan Kim wrote:
> In preparation for converting bit_spin_lock to rwlock in zsmalloc
> so that multiple writers of zspages can run at the same time but
> those zspages are supposed to be different zspage instance. Thus,
> it's not deadlock. This patch adds write_lock_nested to support
> the case for LOCKDEP.
>
> Cc: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>
> ---
> include/linux/rwlock.h | 6 ++++++
> include/linux/rwlock_api_smp.h | 9 +++++++++
> include/linux/rwlock_rt.h | 6 ++++++
> include/linux/spinlock_api_up.h | 1 +
> kernel/locking/spinlock.c | 6 ++++++
> kernel/locking/spinlock_rt.c | 12 ++++++++++++
> 6 files changed, 40 insertions(+)
Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>