From: Konstantin Khlebnikov <koct9i@gmail.com>
To: linux-acpi@vger.kernel.org,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>
Cc: Tom Boshoven <tomboshoven@gmail.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
x86@kernel.org, Josh Triplett <josh@joshtriplett.org>,
Alexander Monakov <amonakov@gmail.com>
Subject: [PATCH v2] ACPI/osl: speedup grace period in acpi_os_map_cleanup
Date: Sun, 09 Nov 2014 13:53:37 +0400 [thread overview]
Message-ID: <20141109105337.4952.36899.stgit@zurg> (raw)
In-Reply-To: <20141108094717.9388.34638.stgit@zurg>
ACPI maintains cache of ioremap regions to speed up operations and
access to them from irq context where ioremap() calls aren't allowed.
This code abuses synchronize_rcu() on unmap path for synchronization
with fast-path in acpi_os_read/write_memory which uses this cache.
Since v3.10 CPUs are allowed to enter idle state even if they have RCU
callbacks queued, see commit c0f4dfd4f90f1667d234d21f15153ea09a2eaa66
("rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks").
That change caused problems with nvidia proprietary driver which calls
acpi_os_map/unmap_generic_address several times during initialization.
Each unmap calls synchronize_rcu and adds significant delay. Totally
initialization is slowed for a couple of seconds and that is enough to
trigger timeout in hardware, gpu decides to "fell off the bus". Widely
spread workaround is reducing "rcu_idle_gp_delay" from 4 to 1 jiffy.
This patch replaces synchronize_rcu() with synchronize_rcu_expedited()
which is much faster.
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-and-tested-by: Alexander Monakov <amonakov@gmail.com>
Cc: Tom Boshoven <tomboshoven@gmail.com>
Link: https://devtalk.nvidia.com/default/topic/567297/linux/linux-3-10-driver-crash/
---
drivers/acpi/osl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 9964f70..217713c 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -436,7 +436,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
static void acpi_os_map_cleanup(struct acpi_ioremap *map)
{
if (!map->refcount) {
- synchronize_rcu();
+ synchronize_rcu_expedited();
acpi_unmap(map->phys, map->virt);
kfree(map);
}
next prev parent reply other threads:[~2014-11-09 10:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 8:47 [PATCH] ACPI/osl: speedup grace period in acpi_os_map_cleanup Konstantin Khlebnikov
2014-11-08 22:13 ` Paul E. McKenney
2014-11-08 23:24 ` Alexander Monakov
2014-11-09 0:51 ` Paul E. McKenney
2014-11-09 11:04 ` Konstantin Khlebnikov
2014-11-09 9:53 ` Konstantin Khlebnikov [this message]
2014-11-09 22:00 ` [PATCH v2] " Paul E. McKenney
2014-11-14 22:48 ` Rafael J. Wysocki
2014-11-14 15:52 ` joeyli
-- strict thread matches above, loose matches on Subject: below --
2015-08-02 17:11 Alexander Mark Diewald
2015-11-04 17:29 Alex Garnett
2015-11-05 2:26 ` Rafael J. Wysocki
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=20141109105337.4952.36899.stgit@zurg \
--to=koct9i@gmail.com \
--cc=amonakov@gmail.com \
--cc=josh@joshtriplett.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rjw@rjwysocki.net \
--cc=tomboshoven@gmail.com \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.