From: Wei Liu Subject: [PATCH] mm: ensure useful progress in decrease_reservation Date: Wed, 26 Feb 2014 11:47:07 +0000 Message-ID: <1393415227-32092-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Keir Fraser , Wei Liu , Jan Beulich , Andrew Cooper List-Id: xen-devel@lists.xenproject.org During my fun time playing with balloon driver I found that hypervisor's preemption check kept decrease_reservation from doing any useful work for 32 bit guests, resulting in hanging the guests. As Andrew suggested, we can force the check to fail for the first iteration to ensure progress. We did this in d3a55d7d9 "x86/mm: Ensure useful progress in alloc_l2_table()" already. After this change I cannot see the hang caused by continuation logic anymore. Signed-off-by: Wei Liu Cc: Jan Beulich Cc: Keir Fraser Cc: Andrew Cooper --- xen/common/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index 5a0efd5..9d0d32e 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -268,7 +268,7 @@ static void decrease_reservation(struct memop_args *a) for ( i = a->nr_done; i < a->nr_extents; i++ ) { - if ( hypercall_preempt_check() ) + if ( hypercall_preempt_check() && i != a->nr_done ) { a->preempted = 1; goto out; -- 1.7.10.4