From: Peter Zijlstra <peterz@infradead.org>
To: Bongkyu Kim <bongkyu7.kim@samsung.com>
Cc: mingo@redhat.com, will@kernel.org, longman@redhat.com,
boqun.feng@gmail.com, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 2/2] locking/rwsem: Make reader optimistic spinning optional
Date: Mon, 4 Sep 2023 17:10:58 +0200 [thread overview]
Message-ID: <20230904151058.GB25717@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20230901010704.18493-3-bongkyu7.kim@samsung.com>
On Fri, Sep 01, 2023 at 10:07:04AM +0900, Bongkyu Kim wrote:
> diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
> index 9c0462d515c1..47c467880af5 100644
> --- a/kernel/locking/rwsem.c
> +++ b/kernel/locking/rwsem.c
> @@ -117,6 +117,17 @@
> # define DEBUG_RWSEMS_WARN_ON(c, sem)
> #endif
>
> +static bool __ro_after_init rwsem_opt_rspin;
> +
> +static int __init opt_rspin(char *str)
> +{
> + rwsem_opt_rspin = true;
> +
> + return 0;
> +}
> +
> +early_param("rwsem.opt_rspin", opt_rspin);
> +
> /*
> * On 64-bit architectures, the bit definitions of the count are:
> *
> @@ -1083,7 +1094,7 @@ static inline bool rwsem_reader_phase_trylock(struct rw_semaphore *sem,
> return false;
> }
>
> -static inline bool rwsem_no_spinners(sem)
> +static inline bool rwsem_no_spinners(struct rw_semaphore *sem)
> {
> return false;
> }
> @@ -1157,6 +1168,9 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int stat
> return sem;
> }
>
> + if (!IS_ENABLED(CONFIG_RWSEM_SPIN_ON_OWNER) || !rwsem_opt_rspin)
> + goto queue;
> +
At the very least this should be a static_branch(), but I still very
much want an answer on how all this interacts with the handoff stuff.
next prev parent reply other threads:[~2023-09-04 15:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230901010734epcas2p4aadced02d68d3db407fda23de34601d2@epcas2p4.samsung.com>
2023-09-01 1:07 ` [PATCH v2 0/2] " Bongkyu Kim
[not found] ` <CGME20230901010734epcas2p1a0d3698e76590637f9175fca40ad9eaf@epcas2p1.samsung.com>
2023-09-01 1:07 ` [PATCH v2 1/2] Revert "locking/rwsem: Remove reader optimistic spinning" Bongkyu Kim
2023-09-04 15:10 ` Peter Zijlstra
2023-09-04 19:11 ` Ingo Molnar
2023-09-04 19:56 ` Waiman Long
2023-09-06 11:27 ` Bongkyu Kim
2023-09-06 13:32 ` Waiman Long
2023-09-20 4:09 ` Bongkyu Kim
[not found] ` <CGME20230901010734epcas2p1490c6648e41dfddeb0cc9c39a101da8b@epcas2p1.samsung.com>
2023-09-01 1:07 ` [PATCH v2 2/2] locking/rwsem: Make reader optimistic spinning optional Bongkyu Kim
2023-09-04 15:10 ` Peter Zijlstra [this message]
2024-04-02 23:46 ` [PATCH v2 0/2] " John Stultz
2024-04-03 1:21 ` Bongkyu Kim
2024-04-03 1:27 ` John Stultz
2024-04-03 1:42 ` Bongkyu Kim
2024-04-04 17:44 ` Waiman Long
2024-04-05 3:06 ` Waiman Long
2024-04-05 6:37 ` Bongkyu Kim
2024-04-05 6:51 ` Bongkyu Kim
2024-04-08 8:15 ` xieliujie
2024-04-09 0:50 ` Bongkyu Kim
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=20230904151058.GB25717@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bongkyu7.kim@samsung.com \
--cc=boqun.feng@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--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
all inboxes | Powered by JetHome®