From: Alexey Starikovskiy <aystarik@gmail.com>
To: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: Reading EeePC900 battery info causes stalls
Date: Thu, 25 Sep 2008 18:57:40 +0400 [thread overview]
Message-ID: <48DBA6E4.80008@gmail.com> (raw)
In-Reply-To: <48DB7D91.4000206@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
Alexey Starikovskiy wrote:
> Sitsofe Wheeler wrote:
>> Alexey Starikovskiy wrote:
>>> acpi_ps_parse_aml() is called not so often (~10000usec), so maybe it
>>> is a "sweet spot"
>>
>> The latency is pretty bad with this patch (assuming you did not want
>> it applied on top of your previous patch)
>>
>> Here's the tail end of a full trace:
>> http://sucs.org/~sits/test/eeepc-debug/20080925/1250/latency_trace_all_tail.gz
>> (3.3Mbytes but close 100Mbytes when decompressed)
>> latency: 2912285 us, #1000038/5344107, CPU#0 | (M:desktop VP:0,
>> KP:0, SP:0 HP:0
>> )
>>
>> Here's a complete (but filtered) trace:
>> http://sucs.org/~sits/test/eeepc-debug/20080925/1250/latency_trace.gz
>> latency: 315814 us, #227600/227600, CPU#0 | (M:desktop VP:0, KP:0,
>> SP:0 HP:0)
>>
> Ok, let's stick with previous patch then.
> It will be somewhat difficult to push though, because the code we
> touched belongs to ACPICA (multi-platform code),
> so should not contain explicit Linux-only operands.
> If you agree that the place is right, I'll make proper patch with all
> needed redirections to
> make ACPICA happy.
Ok, here is the ACPICA-friendly patch, please check if it's still good.
Regards,
Alex.
[-- Attachment #2: acpica_preemption_point.patch --]
[-- Type: text/x-diff, Size: 1806 bytes --]
ACPICA: add preemption point after each opcode parse
From: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/parser/psloop.c | 2 ++
include/acpi/acmacros.h | 5 +++++
include/acpi/platform/aclinux.h | 6 ++++++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index c06238e..4647039 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -719,6 +719,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
*op = NULL;
}
+ ACPI_PREEMPTION_POINT();
+
return_ACPI_STATUS(AE_OK);
}
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 57ab9e9..b402685 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -703,4 +703,9 @@ struct acpi_integer_overlay {
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+/* Preemption point */
+#ifndef ACPI_PREEMPTION_POINT
+#define ACPI_PREEMPTION_POINT() /* no preemption */
+#endif
+
#endif /* ACMACROS_H */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 9af4645..029c8c0 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -53,6 +53,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ctype.h>
+#include <linux/sched.h>
#include <asm/system.h>
#include <asm/atomic.h>
#include <asm/div64.h>
@@ -137,4 +138,9 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
#define ACPI_FREE(a) kfree(a)
+/*
+ * We need to show where it is safe to preempt execution of ACPICA
+ */
+#define ACPI_PREEMPTION_POINT() cond_resched()
+
#endif /* __ACLINUX_H__ */
next prev parent reply other threads:[~2008-09-25 14:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 17:52 Reading EeePC900 battery info causes stalls Sitsofe Wheeler
2008-09-25 8:47 ` Alexey Starikovskiy
2008-09-25 9:35 ` Sitsofe Wheeler
2008-09-25 9:36 ` Sitsofe Wheeler
2008-09-25 9:54 ` Alexey Starikovskiy
2008-09-25 11:07 ` Alexey Starikovskiy
2008-09-25 11:56 ` Sitsofe Wheeler
2008-09-25 12:01 ` Alexey Starikovskiy
2008-09-25 14:57 ` Alexey Starikovskiy [this message]
2008-09-25 17:30 ` Sitsofe Wheeler
2008-09-25 11:17 ` Sitsofe Wheeler
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=48DBA6E4.80008@gmail.com \
--to=aystarik@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=sitsofe@yahoo.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;
as well as URLs for NNTP newsgroup(s).