|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.2] common: make hypercall preemption checks consistent
commit 584eb273dbd8f4325f419c0d1e160f1579c9efa4
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Apr 9 11:28:46 2014 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Apr 9 11:28:46 2014 +0200
common: make hypercall preemption checks consistent
- never preempt on the first iteration (ensure forward progress)
- do cheap checks first
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Tim Deegan <tim@xxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
master commit: 8c0eed2cc8d8a2ccccdffe4c386b625b672dc12a
master date: 2014-03-13 14:26:35 +0100
---
xen/common/memory.c | 9 +++++----
xen/common/multicall.c | 2 +-
xen/drivers/char/console.c | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/xen/common/memory.c b/xen/common/memory.c
index a515d1d..40f3e3e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -59,7 +59,7 @@ static void increase_reservation(struct memop_args *a)
for ( i = a->nr_done; i < a->nr_extents; i++ )
{
- if ( hypercall_preempt_check() )
+ if ( i != a->nr_done && hypercall_preempt_check() )
{
a->preempted = 1;
goto out;
@@ -104,7 +104,7 @@ static void populate_physmap(struct memop_args *a)
for ( i = a->nr_done; i < a->nr_extents; i++ )
{
- if ( hypercall_preempt_check() )
+ if ( i != a->nr_done && hypercall_preempt_check() )
{
a->preempted = 1;
goto out;
@@ -242,7 +242,7 @@ static void decrease_reservation(struct memop_args *a)
for ( i = a->nr_done; i < a->nr_extents; i++ )
{
- if ( hypercall_preempt_check() )
+ if ( i != a->nr_done && hypercall_preempt_check() )
{
a->preempted = 1;
goto out;
@@ -355,7 +355,8 @@ static long
memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
i < (exch.in.nr_extents >> in_chunk_order);
i++ )
{
- if ( hypercall_preempt_check() )
+ if ( i != (exch.nr_exchanged >> in_chunk_order) &&
+ hypercall_preempt_check() )
{
exch.nr_exchanged = i << in_chunk_order;
rcu_unlock_domain(d);
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index 6c1a9d7..697a3f3 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -38,7 +38,7 @@ do_multicall(
for ( i = 0; !rc && i < nr_calls; i++ )
{
- if ( hypercall_preempt_check() )
+ if ( i && hypercall_preempt_check() )
goto preempted;
if ( unlikely(__copy_from_guest(&mcs->call, call_list, 1)) )
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ef24f63..8579711 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -323,11 +323,11 @@ static
DECLARE_SOFTIRQ_TASKLET(notify_dom0_con_ring_tasklet,
static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count)
{
char kbuf[128], *kptr;
- int kcount;
+ int kcount = 0;
while ( count > 0 )
{
- if ( hypercall_preempt_check() )
+ if ( kcount && hypercall_preempt_check() )
return hypercall_create_continuation(
__HYPERVISOR_console_io, "iih",
CONSOLEIO_write, count, buffer);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |