linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake()
@ 2021-07-06  4:50 Yehan Xu
  2021-07-06 12:52 ` Waiman Long
  2021-07-27 13:58 ` [tip: locking/core] " tip-bot2 for xuyehan
  0 siblings, 2 replies; 3+ messages in thread
From: Yehan Xu @ 2021-07-06  4:50 UTC (permalink / raw)
  To: peterz, mingo, will; +Cc: longman, boqun.feng, linux-kernel, xuyehan

From: xuyehan <xuyehan@xiaomi.com>

The 2nd parameter 'count' is not used in this function.
The places where the function is called are also modified.

Signed-off-by: xuyehan <xuyehan@xiaomi.com>
---
 kernel/locking/rwsem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 16bfbb1..8a595b6 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1165,7 +1165,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
  * handle waking up a waiter on the semaphore
  * - up_read/up_write has decremented the active part of count if we come here
  */
-static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem, long count)
+static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
 {
 	unsigned long flags;
 	DEFINE_WAKE_Q(wake_q);
@@ -1297,7 +1297,7 @@ static inline void __up_read(struct rw_semaphore *sem)
 	if (unlikely((tmp & (RWSEM_LOCK_MASK|RWSEM_FLAG_WAITERS)) ==
 		      RWSEM_FLAG_WAITERS)) {
 		clear_nonspinnable(sem);
-		rwsem_wake(sem, tmp);
+		rwsem_wake(sem);
 	}
 }
 
@@ -1319,7 +1319,7 @@ static inline void __up_write(struct rw_semaphore *sem)
 	rwsem_clear_owner(sem);
 	tmp = atomic_long_fetch_add_release(-RWSEM_WRITER_LOCKED, &sem->count);
 	if (unlikely(tmp & RWSEM_FLAG_WAITERS))
-		rwsem_wake(sem, tmp);
+		rwsem_wake(sem);
 }
 
 /*
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake()
  2021-07-06  4:50 [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake() Yehan Xu
@ 2021-07-06 12:52 ` Waiman Long
  2021-07-27 13:58 ` [tip: locking/core] " tip-bot2 for xuyehan
  1 sibling, 0 replies; 3+ messages in thread
From: Waiman Long @ 2021-07-06 12:52 UTC (permalink / raw)
  To: Yehan Xu, peterz, mingo, will; +Cc: boqun.feng, linux-kernel, xuyehan

On 7/6/21 12:50 AM, Yehan Xu wrote:
> From: xuyehan <xuyehan@xiaomi.com>
>
> The 2nd parameter 'count' is not used in this function.
> The places where the function is called are also modified.
>
> Signed-off-by: xuyehan <xuyehan@xiaomi.com>
> ---
>   kernel/locking/rwsem.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
> index 16bfbb1..8a595b6 100644
> --- a/kernel/locking/rwsem.c
> +++ b/kernel/locking/rwsem.c
> @@ -1165,7 +1165,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
>    * handle waking up a waiter on the semaphore
>    * - up_read/up_write has decremented the active part of count if we come here
>    */
> -static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem, long count)
> +static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
>   {
>   	unsigned long flags;
>   	DEFINE_WAKE_Q(wake_q);
> @@ -1297,7 +1297,7 @@ static inline void __up_read(struct rw_semaphore *sem)
>   	if (unlikely((tmp & (RWSEM_LOCK_MASK|RWSEM_FLAG_WAITERS)) ==
>   		      RWSEM_FLAG_WAITERS)) {
>   		clear_nonspinnable(sem);
> -		rwsem_wake(sem, tmp);
> +		rwsem_wake(sem);
>   	}
>   }
>   
> @@ -1319,7 +1319,7 @@ static inline void __up_write(struct rw_semaphore *sem)
>   	rwsem_clear_owner(sem);
>   	tmp = atomic_long_fetch_add_release(-RWSEM_WRITER_LOCKED, &sem->count);
>   	if (unlikely(tmp & RWSEM_FLAG_WAITERS))
> -		rwsem_wake(sem, tmp);
> +		rwsem_wake(sem);
>   }
>   
>   /*

Right, the count parameter was added in the past for some optimization 
which had since been taken out. So it is no longer needed.

Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: locking/core] locking/rwsem: Remove an unused parameter of rwsem_wake()
  2021-07-06  4:50 [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake() Yehan Xu
  2021-07-06 12:52 ` Waiman Long
@ 2021-07-27 13:58 ` tip-bot2 for xuyehan
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for xuyehan @ 2021-07-27 13:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: xuyehan, Peter Zijlstra (Intel), Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     d4e5076c3522658996dbb050aa6c708bd2c1a3c1
Gitweb:        https://git.kernel.org/tip/d4e5076c3522658996dbb050aa6c708bd2c1a3c1
Author:        xuyehan <xuyehan@xiaomi.com>
AuthorDate:    Tue, 06 Jul 2021 12:50:43 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 16 Jul 2021 18:46:44 +02:00

locking/rwsem: Remove an unused parameter of rwsem_wake()

The 2nd parameter 'count' is not used in this function.
The places where the function is called are also modified.

Signed-off-by: xuyehan <xuyehan@xiaomi.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lore.kernel.org/r/1625547043-28103-1-git-send-email-yehanxu1@gmail.com
---
 kernel/locking/rwsem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 809b001..2cad15d 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1165,7 +1165,7 @@ out_nolock:
  * handle waking up a waiter on the semaphore
  * - up_read/up_write has decremented the active part of count if we come here
  */
-static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem, long count)
+static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
 {
 	unsigned long flags;
 	DEFINE_WAKE_Q(wake_q);
@@ -1297,7 +1297,7 @@ static inline void __up_read(struct rw_semaphore *sem)
 	if (unlikely((tmp & (RWSEM_LOCK_MASK|RWSEM_FLAG_WAITERS)) ==
 		      RWSEM_FLAG_WAITERS)) {
 		clear_nonspinnable(sem);
-		rwsem_wake(sem, tmp);
+		rwsem_wake(sem);
 	}
 }
 
@@ -1319,7 +1319,7 @@ static inline void __up_write(struct rw_semaphore *sem)
 	rwsem_clear_owner(sem);
 	tmp = atomic_long_fetch_add_release(-RWSEM_WRITER_LOCKED, &sem->count);
 	if (unlikely(tmp & RWSEM_FLAG_WAITERS))
-		rwsem_wake(sem, tmp);
+		rwsem_wake(sem);
 }
 
 /*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-27 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  4:50 [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake() Yehan Xu
2021-07-06 12:52 ` Waiman Long
2021-07-27 13:58 ` [tip: locking/core] " tip-bot2 for xuyehan

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 NNTP newsgroup(s).