The fix is to cond_sched() only when preemptible, which means not in
irq_disabled or in_atomic.
Reported-and-bisected-by: Larry Finger <Larry....@lwfinger.net>
Signed-off-by: Xiaotian Feng <df...@redhat.com>
---
include/acpi/platform/aclinux.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 9d7febd..5b415ee 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -152,7 +152,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
#include <linux/hardirq.h>
#define ACPI_PREEMPTION_POINT() \
do { \
- if (!in_atomic_preempt_off()) \
+ if (preemptible()) \
cond_resched(); \
} while (0)
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
looks good
kernel compiled without any issues,
echo mem > /sys/power/state
reported no warning message.
Also if you don't mind add:
Reported-and-bisected-by: Justin P. Mattock <justin...@gmail.com>
Id like to get some kind of credit for this b*tch.
--
Justin P. Mattock
http://bugzilla.kernel.org/show_bug.cgi?id=14483
> Id like to get some kind of credit for this b*tch.
>
--
no worries.. I'll run
my system with this change
to see if anything happens.
As for the bug, leave it open
until this makes it's way into
the main kernel, then rafael can
close it
Justin P. Mattock
Any feedbacks?
Regards
Xiaotian
Note that this is ugly as hell. It means we have two acpi
interpretters in kernel, one for preemptible, one for non-preemptible,
with very different behaviour.
It would be slightly nicer to pass the "preemptible" info explicitely,
as function parameters.
It would be even better not to need that difference.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
This patch also fixes http://bugzilla.kernel.org/show_bug.cgi?id=14483
Reported-and-bisected-by: Larry Finger <Larry....@lwfinger.net>
Reported-and-bisected-by: Justin P. Mattock <justin...@gmail.com>
Signed-off-by: Xiaotian Feng <df...@redhat.com>
Cc: Len Brown <le...@kernel.org>
Cc: Bob Moore <robert...@intel.com>
Cc: Lin Ming <ming....@intel.com>
Cc: Alexey Starikovskiy <astari...@suse.de>
Cc: Pavel Machek <pa...@ucw.cz>
---
include/acpi/platform/aclinux.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 9d7febd..0946997 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -152,7 +152,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
#include <linux/hardirq.h>
#define ACPI_PREEMPTION_POINT() \
do { \
- if (!in_atomic_preempt_off()) \
+ if (!in_atomic_preempt_off() && !irqs_disabled()) \
cond_resched(); \
} while (0)
--
1.6.5.2
--
I think, this is another round of "armor vs. bullet" race... It will hold until
might_sleep() logic changes again.
Please consider using preemptible() -- IMHO this is the check we should perform
in our case of voluntary preemption.
Regards,
Alex.
Xiaotian Feng пишет:
--
Please elaborate... Your comments "ugly as hell" are too often to be
specific...
There is only one use of ACPI_PREEMPTION_POINT(), and it is in the
ACPICA code,
which we all agreed to keep OS independent, thus the need for #define.
Do you see any other way to add preemption point without introducing
Linux-specific
code into ACPICA?
Thanks,
Alex.
Pavel Machek пишет:
--
I believe we want linux-specific code in acpica at this point.
(Or maybe... I guess other systems have concept of preemption and not
all actions are permitted from all contexts, so maybe something like
that would be important for them, too?)
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Please post the code, which will do the above and will not look "ugly as
hell".
I still don't follow your vague comments.
> (Or maybe... I guess other systems have concept of preemption and not
> all actions are permitted from all contexts, so maybe something like
> that would be important for them, too?)
>
None of them cared about it up to this point.
With the macro above we allowed them to follow Linux, but to go or not
is their call.
Regards,
Alex.
o.k. I went did a pull to update
the kernel, and then changed
aclinux.h to the above post.
I'm am not seeing this warning message
upon wake-up.
but with the acpi merge stuff with
acpi_walk_namespace seems to break nvidia
(nvidia's problem now)
there is also some thing where the machine
takes a good 30 secs or so to wake up
(not sure if this is from the updated patch)
in dmesg I see:
platform microcode: firmware requesting intel-ucode/06-17-0a
firmware microcode: parent mocrocode should not be sleeping.
I'm thinking I need something in /lib/firmare
Justin P. Mattock
Bob
>-----Original Message-----
>From: Justin P. Mattock [mailto:justin...@gmail.com]
>Sent: Thursday, December 10, 2009 2:46 PM
>To: Alexey Starikovskiy
>Cc: Pavel Machek; Xiaotian Feng; le...@kernel.org; Lin, Ming M; Moore,
>Robert; linux...@vger.kernel.org; linux-...@vger.kernel.org
>Subject: Re: [PATCH] ACPICA: don't cond_resched() when irq_disabled or
>in_atomic
>
>On 12/10/09 10:37, Alexey Starikovskiy wrote:
>> Pavel Machek О©╫О©╫О©╫О©╫О©╫:
preemptible() may not work here because it always returns 0 for
non-preemptible kernel.
#ifdef CONFIG_PREEMPT
# define preemptible() (preempt_count() == 0 && !irqs_disabled())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else
# define preemptible() 0
# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
#endif
Lin Ming
Well, normally we want low latency even for !CONFIG_PREEMPT kernels.
Actually, explicit preemption points are NOPs for CONFIG_PREEMPT
kernels, right?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Thanks,
Alex.
> Right. Do you have code?
I'd prefer to spend my time with patches to areas that actually do
take cleanup patches.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Yes, so pass explicit argument to the interpretter, telling it what
kind of context it runs on. Similar to kmalloc's GFP_KERNEL
vs. GFP_ATOMIC.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
What's the status of this now? We can still see the sleeping function
call warning or enable irq at resume stage.
If acpi wants low latency even for !CONFIG_PREEMPT kernels, what's wrong
with V2 patch?
We should not set any preemption points in irq or atomic. Since we have
a simple fix, and it did fix bugs, why should
we make things more complex?
> Pavel
Thanks,
Alex
> Xiaotian Feng пишет:
> > What's the status of this now? We can still see the sleeping function
> > call warning or enable irq at resume stage.
> > If acpi wants low latency even for !CONFIG_PREEMPT kernels, what's wrong
> > with V2 patch?
> >
> > We should not set any preemption points in irq or atomic. Since we have
> > a simple fix, and it did fix bugs, why should
> > we make things more complex?
> We should not do anything complex here, you are right.
> Consider me ACK your patch.
This patch has been in the acpi-test tree for a while
and I'll push it upstream with the next batch.
thanks,
Len Brown, Intel Open Source Technology Center
> Let me know when you guys have finalized any changes to aclinux.h, and I will update this file in the base ACPICA code.
I think the v2 patch will go upstream.
Not super-critical to have ACPICA sync with Linux's aclinux.h,
since Linux has it already, but good hygine, I guess.
thanks,
-Len Brown, Intel Open Source Technology Center