Re: [PATCH] locking: fix typos in comments

From: Waiman Long

Date: Thu Apr 16 2026 - 11:12:51 EST



On 4/16/26 5:04 AM, Xiang Gao wrote:
From: Xiang Gao <gaoxiang17@xxxxxxxxxx>

Fix the following typos in comments:

mutex.c: "crital" -> "critical" (2 instances)
mutex.c: "task_strcut" -> "task_struct" (2 instances)
rwsem.c: "Otherwisee" -> "Otherwise"
rwsem.c: "crital" -> "critical" (2 instances)
rwsem.c: "task_strcut" -> "task_struct"

Signed-off-by: Xiang Gao <gaoxiang17@xxxxxxxxxx>
---
kernel/locking/mutex.c | 6 +++---
kernel/locking/rwsem.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 186b463fe326..658cebc0958d 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -380,8 +380,8 @@ bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner,
* Ensure we emit the owner->on_cpu, dereference _after_
* checking lock->owner still matches owner. And we already
* disabled preemption which is equal to the RCU read-side
- * crital section in optimistic spinning code. Thus the
- * task_strcut structure won't go away during the spinning
+ * critical section in optimistic spinning code. Thus the
+ * task_struct structure won't go away during the spinning
* period
*/
barrier();
@@ -420,7 +420,7 @@ static inline int mutex_can_spin_on_owner(struct mutex *lock)
/*
* We already disabled preemption which is equal to the RCU read-side
- * crital section in optimistic spinning code. Thus the task_strcut
+ * critical section in optimistic spinning code. Thus the task_struct
* structure won't go away during the spinning period.
*/
owner = __mutex_owner(lock);
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index bf647097369c..016d69053ce4 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -638,7 +638,7 @@ static inline bool rwsem_try_write_lock(struct rw_semaphore *sem,
if (has_handoff) {
/*
* Honor handoff bit and yield only when the first
- * waiter is the one that set it. Otherwisee, we
+ * waiter is the one that set it. Otherwise, we
* still try to acquire the rwsem.
*/
if (first->handoff_set && (waiter != first))
@@ -737,8 +737,8 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem)
}
/*
- * Disable preemption is equal to the RCU read-side crital section,
- * thus the task_strcut structure won't go away.
+ * Disable preemption is equal to the RCU read-side critical section,
+ * thus the task_struct structure won't go away.
*/
owner = rwsem_owner_flags(sem, &flags);
/*
@@ -796,7 +796,7 @@ rwsem_spin_on_owner(struct rw_semaphore *sem)
* checking sem->owner still matches owner, if that fails,
* owner might point to free()d memory, if it still matches,
* our spinning context already disabled preemption which is
- * equal to RCU read-side crital section ensures the memory
+ * equal to RCU read-side critical section ensures the memory
* stays valid.
*/
barrier();
Acked-by: Waiman Long <longman@xxxxxxxxxx>