[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210409025131.4114078-16-willy@infradead.org>
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