From: Waiman Long <llong@redhat.com>
To: Yehan Xu <yehanxu1@gmail.com>,
peterz@infradead.org, mingo@redhat.com, will@kernel.org
Cc: boqun.feng@gmail.com, linux-kernel@vger.kernel.org,
xuyehan <xuyehan@xiaomi.com>
Subject: Re: [PATCH] locking/rwsem: Remove an unused parameter of rwsem_wake()
Date: Tue, 6 Jul 2021 08:52:53 -0400 [thread overview]
Message-ID: <a9be100c-b7b5-4353-37ea-e88d06bc5d2f@redhat.com> (raw)
In-Reply-To: <1625547043-28103-1-git-send-email-yehanxu1@gmail.com>
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>
next prev parent reply other threads:[~2021-07-06 12:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 4:50 Yehan Xu
2021-07-06 12:52 ` Waiman Long [this message]
2021-07-27 13:58 ` [tip: locking/core] " tip-bot2 for xuyehan
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=a9be100c-b7b5-4353-37ea-e88d06bc5d2f@redhat.com \
--to=llong@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=xuyehan@xiaomi.com \
--cc=yehanxu1@gmail.com \
/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
all inboxes | Powered by JetHome®