From: John Allen <jallen@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: nfont@linux.vnet.ibm.com
Subject: Re: [PATCH 1/2] powerpc/pseries: Avoid blocking rtas polling handling multiple PRRN events
Date: Mon, 16 Jul 2018 16:23:15 -0500 [thread overview]
Message-ID: <20180716212315.c5l45vakxo3cawxf@p50> (raw)
In-Reply-To: <20180713142224.4516-2-jallen@linux.ibm.com>
On Fri, Jul 13, 2018 at 09:22:23AM -0500, John Allen wrote:
>When a PRRN event is being handled and another PRRN event comes in, the
>second event will block rtas polling waiting on the first to complete,
>preventing any further rtas events from being handled. This can be
>especially problematic in case that PRRN events are continuously being
>queued in which case rtas polling gets indefinitely blocked completely.
>
>This patch introduces a mutex that prevents any subsequent PRRN events from
>running while there is a prrn event being handled, allowing rtas polling to
>continue normally.
>
>Signed-off-by: John Allen <jallen@linux.ibm.com>
>---
> arch/powerpc/kernel/rtasd.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
>diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
>index 44d66c33d59d..8a72a53d62c0 100644
>--- a/arch/powerpc/kernel/rtasd.c
>+++ b/arch/powerpc/kernel/rtasd.c
>@@ -35,6 +35,8 @@
>
> static DEFINE_SPINLOCK(rtasd_log_lock);
>
>+static DEFINE_MUTEX(prrn_lock);
>+
> static DECLARE_WAIT_QUEUE_HEAD(rtas_log_wait);
>
> static char *rtas_log_buf;
>@@ -290,9 +292,12 @@ static DECLARE_WORK(prrn_work, prrn_work_fn);
>
> static void prrn_schedule_update(u32 scope)
> {
>- flush_work(&prrn_work);
>- prrn_update_scope = scope;
>- schedule_work(&prrn_work);
>+ if (mutex_trylock(&prrn_lock)) {
>+ flush_work(&prrn_work);
>+ prrn_update_scope = scope;
>+ schedule_work(&prrn_work);
>+ mutex_unlock(&prrn_lock);
This appears to be bugged. The mutex_unlock should be done elsewhere.
Will send an updated version.
-John
>+ }
> }
>
> static void handle_rtas_event(const struct rtas_error_log *log)
>--
>2.17.1
>
next prev parent reply other threads:[~2018-07-16 21:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 14:22 [PATCH 0/2] powerpc/pseries: Improve serialization of PRRN events John Allen
2018-07-13 14:22 ` [PATCH 1/2] powerpc/pseries: Avoid blocking rtas polling handling multiple " John Allen
2018-07-16 21:23 ` John Allen [this message]
2018-07-13 14:22 ` [PATCH 2/2] powerpc/pseries: Wait for completion of hotplug events during PRRN handling John Allen
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=20180716212315.c5l45vakxo3cawxf@p50 \
--to=jallen@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nfont@linux.vnet.ibm.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