Linux-arch Archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@loongson.cn>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Cc: Huacai Chen <chenhuacai@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>, Guo Ren <guoren@kernel.org>,
	Rui Wang <wangrui@loongson.cn>, WANG Xuerui <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Huacai Chen <chenhuacai@loongson.cn>
Subject: [PATCH 1/2] mmiowb: Rename mmiowb_spin_{lock, unlock}() to mmiowb_in_{lock, unlock}()
Date: Fri,  1 Mar 2024 21:05:31 +0800	[thread overview]
Message-ID: <20240301130532.3953167-1-chenhuacai@loongson.cn> (raw)

We are extending mmiowb tracking system from spinlock to mutex, so
rename mmiowb_spin_{lock, unlock}() to mmiowb_in_{lock, unlock}() to
reflect the fact. No functional changes.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 include/asm-generic/mmiowb.h    | 8 ++++----
 include/linux/spinlock.h        | 6 +++---
 kernel/locking/spinlock_debug.c | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/asm-generic/mmiowb.h b/include/asm-generic/mmiowb.h
index 5698fca3bf56..eb2335f9f35e 100644
--- a/include/asm-generic/mmiowb.h
+++ b/include/asm-generic/mmiowb.h
@@ -40,13 +40,13 @@ static inline void mmiowb_set_pending(void)
 		ms->mmiowb_pending = ms->nesting_count;
 }
 
-static inline void mmiowb_spin_lock(void)
+static inline void mmiowb_in_lock(void)
 {
 	struct mmiowb_state *ms = __mmiowb_state();
 	ms->nesting_count++;
 }
 
-static inline void mmiowb_spin_unlock(void)
+static inline void mmiowb_in_unlock(void)
 {
 	struct mmiowb_state *ms = __mmiowb_state();
 
@@ -59,7 +59,7 @@ static inline void mmiowb_spin_unlock(void)
 }
 #else
 #define mmiowb_set_pending()		do { } while (0)
-#define mmiowb_spin_lock()		do { } while (0)
-#define mmiowb_spin_unlock()		do { } while (0)
+#define mmiowb_in_lock()		do { } while (0)
+#define mmiowb_in_unlock()		do { } while (0)
 #endif	/* CONFIG_MMIOWB */
 #endif	/* __ASM_GENERIC_MMIOWB_H */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 3fcd20de6ca8..60eda70cddd0 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -185,7 +185,7 @@ static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock)
 {
 	__acquire(lock);
 	arch_spin_lock(&lock->raw_lock);
-	mmiowb_spin_lock();
+	mmiowb_in_lock();
 }
 
 static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
@@ -193,14 +193,14 @@ static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
 	int ret = arch_spin_trylock(&(lock)->raw_lock);
 
 	if (ret)
-		mmiowb_spin_lock();
+		mmiowb_in_lock();
 
 	return ret;
 }
 
 static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
 {
-	mmiowb_spin_unlock();
+	mmiowb_in_unlock();
 	arch_spin_unlock(&lock->raw_lock);
 	__release(lock);
 }
diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c
index 87b03d2e41db..632a88322433 100644
--- a/kernel/locking/spinlock_debug.c
+++ b/kernel/locking/spinlock_debug.c
@@ -114,7 +114,7 @@ void do_raw_spin_lock(raw_spinlock_t *lock)
 {
 	debug_spin_lock_before(lock);
 	arch_spin_lock(&lock->raw_lock);
-	mmiowb_spin_lock();
+	mmiowb_in_lock();
 	debug_spin_lock_after(lock);
 }
 
@@ -123,7 +123,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock)
 	int ret = arch_spin_trylock(&lock->raw_lock);
 
 	if (ret) {
-		mmiowb_spin_lock();
+		mmiowb_in_lock();
 		debug_spin_lock_after(lock);
 	}
 #ifndef CONFIG_SMP
@@ -137,7 +137,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock)
 
 void do_raw_spin_unlock(raw_spinlock_t *lock)
 {
-	mmiowb_spin_unlock();
+	mmiowb_in_unlock();
 	debug_spin_unlock(lock);
 	arch_spin_unlock(&lock->raw_lock);
 }
-- 
2.43.0


             reply	other threads:[~2024-03-01 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 13:05 Huacai Chen [this message]
2024-03-01 13:05 ` [PATCH 2/2] mmiowb: Hook up mmiowb helpers to mutexes as well as spinlocks Huacai Chen
2024-04-12 13:32   ` Will Deacon
2024-04-12 14:35     ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240301130532.3953167-1-chenhuacai@loongson.cn \
    --to=chenhuacai@loongson.cn \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wangrui@loongson.cn \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).