* [PATCH] xen: Resume PMU from non-atomic context
@ 2015-12-02 17:10 Boris Ostrovsky
2015-12-02 17:18 ` [Xen-devel] " David Vrabel
0 siblings, 1 reply; 2+ messages in thread
From: Boris Ostrovsky @ 2015-12-02 17:10 UTC (permalink / raw)
To: konrad.wilk, david.vrabel
Cc: xen-devel, linux-kernel, Boris Ostrovsky, stable
Resuming PMU currently triggers a warning from ___might_sleep() (assuming
CONFIG_DEBUG_ATOMIC_SLEEP is set) when xen_pmu_init() allocates GFP_KERNEL
page because we are in state resembling atomic context.
Move resuming PMU to xen_arch_resume() which is called in regular context.
For symmetry move suspending PMU to xen_arch_suspend() as well.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <stable@vger.kernel.org> # 4.3
---
arch/x86/xen/suspend.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index feddabd..3705eab 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -68,26 +68,16 @@ static void xen_pv_post_suspend(int suspend_cancelled)
void xen_arch_pre_suspend(void)
{
- int cpu;
-
- for_each_online_cpu(cpu)
- xen_pmu_finish(cpu);
-
if (xen_pv_domain())
xen_pv_pre_suspend();
}
void xen_arch_post_suspend(int cancelled)
{
- int cpu;
-
if (xen_pv_domain())
xen_pv_post_suspend(cancelled);
else
xen_hvm_post_suspend(cancelled);
-
- for_each_online_cpu(cpu)
- xen_pmu_init(cpu);
}
static void xen_vcpu_notify_restore(void *data)
@@ -106,10 +96,20 @@ static void xen_vcpu_notify_suspend(void *data)
void xen_arch_resume(void)
{
+ int cpu;
+
on_each_cpu(xen_vcpu_notify_restore, NULL, 1);
+
+ for_each_online_cpu(cpu)
+ xen_pmu_init(cpu);
}
void xen_arch_suspend(void)
{
+ int cpu;
+
+ for_each_online_cpu(cpu)
+ xen_pmu_finish(cpu);
+
on_each_cpu(xen_vcpu_notify_suspend, NULL, 1);
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Xen-devel] [PATCH] xen: Resume PMU from non-atomic context
2015-12-02 17:10 [PATCH] xen: Resume PMU from non-atomic context Boris Ostrovsky
@ 2015-12-02 17:18 ` David Vrabel
0 siblings, 0 replies; 2+ messages in thread
From: David Vrabel @ 2015-12-02 17:18 UTC (permalink / raw)
To: Boris Ostrovsky, konrad.wilk, david.vrabel
Cc: xen-devel, linux-kernel, stable
On 02/12/15 17:10, Boris Ostrovsky wrote:
> Resuming PMU currently triggers a warning from ___might_sleep() (assuming
> CONFIG_DEBUG_ATOMIC_SLEEP is set) when xen_pmu_init() allocates GFP_KERNEL
> page because we are in state resembling atomic context.
>
> Move resuming PMU to xen_arch_resume() which is called in regular context.
> For symmetry move suspending PMU to xen_arch_suspend() as well.
Applied to for-linus-4.4, thanks.
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-02 17:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-02 17:10 [PATCH] xen: Resume PMU from non-atomic context Boris Ostrovsky
2015-12-02 17:18 ` [Xen-devel] " David Vrabel
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).