lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 9 Apr 2021 03:51:29 +0100 From: "Matthew Wilcox (Oracle)" <willy@...radead.org> To: neilb@...e.de, peterz@...radead.org, mingo@...hat.com, will@...nel.org, longman@...hat.com, boqun.feng@...il.com, tglx@...utronix.de, bigeasy@...utronix.de Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>, linux-kernel@...r.kernel.org Subject: [PATCH 15/17] zsmalloc: Add zs_pin_lock Allow lockdep to track zsmalloc's pin bit spin lock. Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org> --- mm/zsmalloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 9a7c91c14b84..9d89a1857901 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -874,6 +874,8 @@ static unsigned long obj_to_head(struct page *page, void *obj) return *(unsigned long *)obj; } +static DEFINE_SPLIT_LOCK(zs_pin_lock); + static inline int testpin_tag(unsigned long handle) { return bit_spin_is_locked(HANDLE_PIN_BIT, (unsigned long *)handle); @@ -881,17 +883,20 @@ static inline int testpin_tag(unsigned long handle) static inline int trypin_tag(unsigned long handle) { - return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle); + return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle, + &zs_pin_lock); } static void pin_tag(unsigned long handle) __acquires(bitlock) { - bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle); + bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle, + &zs_pin_lock); } static void unpin_tag(unsigned long handle) __releases(bitlock) { - bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle); + bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle, + &zs_pin_lock); } static void reset_page(struct page *page) -- 2.30.2
Powered by blists - more mailing lists