From patchwork Thu Mar 9 11:34:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Pinto X-Patchwork-Id: 9613133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE826602B4 for ; Thu, 9 Mar 2017 11:36:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBED828586 for ; Thu, 9 Mar 2017 11:36:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0CA2285F5; Thu, 9 Mar 2017 11:36:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89F0028586 for ; Thu, 9 Mar 2017 11:36:03 +0000 (UTC) Received: from localhost ([::1]:33388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clwMU-00063f-Js for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Mar 2017 06:36:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clwM0-0005zm-KI for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clwLz-0004mn-BH for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:35:32 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clwLz-0004mb-52 for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:35:31 -0500 Received: by mail-wm0-x241.google.com with SMTP id v190so10451982wme.3 for ; Thu, 09 Mar 2017 03:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtualopensystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5KRMPeHjrmfI54FrHLSgg3sfa9cedIJuSuq0fWLPaLg=; b=PtHMJbXgo7SiUGiO2DItnwxaLmdQaztuhePkDqecXka94d5ZVFvPiWXAGdBVkyQb/O mXgY26Fkut/OdVwuyXdoIlNmUrLWlICie9mHABsBrl70Hf1XckGHtKk6qW6XG7AuzUTl Fs8eqlfXOWEfKIiUYoHmNfS0cch7TFmz47XeP7jblzIh0XtnqD6qb9Jd/YBZmFRTh45X 4mkYlHAguGc2vkuyT1gbjt9DEI6CJF873EfNV/P17KRa7bVQuJYhuaHivYjjk3UcBWCe 6kBNN4QR+t+4MAUkh/FVH1bYTxfquamoI86sbVuvzh8blchrJtKRD+S0Vp/ZmHGz4elS GORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5KRMPeHjrmfI54FrHLSgg3sfa9cedIJuSuq0fWLPaLg=; b=lNBQYvNQxCqUe7QGCQaNwI36sZ7p+OBmu6gobG9mnc30ynAEGSSth0dg8AZ65MhHzk 2QPVvoVjvIwNdB/EhZmvSlcdDZR1mZpACWJR+uhBNYOVMZLURTHL39YDsBmv7fd9udDU luKzjebHjp9kKN+xGuRbrb7cP4b1ONF7a79Ehwm51OQtNMi1FIxHB7LjhAlSm7EEYvvD /mic9MXwDX/DJa4mTDp62aR3N3ECjuHXdqwKjIx+gCKf4E16SS96DsqHrYzF/2f+crni eCnSuEEEzbM9/hHIxB2vnT9rQdjp6poKEt8Tfh3LKck3mPVxTJOY8/woi0wXPeTBvgVg HSTA== X-Gm-Message-State: AMke39lC/VIj5Rw5YG1Mz5NEbfPxgyCWqddGEIAbE95txW0dXMilsTYyQ8HRKQA1ZiiJXw== X-Received: by 10.28.142.16 with SMTP id q16mr27608126wmd.78.1489059330216; Thu, 09 Mar 2017 03:35:30 -0800 (PST) Received: from bumma.localdomain ([151.67.127.177]) by smtp.googlemail.com with ESMTPSA id 36sm7876460wrk.57.2017.03.09.03.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 03:35:29 -0800 (PST) From: Christian Pinto To: zhang.zhanghailiang@huawei.com Date: Thu, 9 Mar 2017 12:34:37 +0100 Message-Id: <20170309113437.9667-5-c.pinto@virtualopensystems.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170309113437.9667-1-c.pinto@virtualopensystems.com> References: <57B7F948.9040701@huawei.com> <20170309113437.9667-1-c.pinto@virtualopensystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [RFC PATCH 4/4] migration/postcopy-ram: ram_set_pages_wp fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aarcange@redhat.com, b.reynal@virtualopensystems.com, quintela@redhat.com, qemu-devel@nongnu.org, hanweidong@huawei.com, peter.huangpeng@huawei.com, Christian Pinto , dgilbert@redhat.com, amit.shah@redhat.com, tech@virtualopensystems.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP setting UFFDIO_WRITEPROTECT_MODE_DONTWAKE when write un-protecting a page does not wake up the faulting thread. Set to 0 to force the faulting (VM) thread to wake-up. Signed-off-by: Christian Pinto Signed-off-by: Baptiste Reynal --- migration/postcopy-ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 6252eb379a..684faae614 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -384,7 +384,7 @@ int ram_set_pages_wp(ram_addr_t page_addr, wp_struct.range.start = (uint64_t)(uintptr_t)page_addr; wp_struct.range.len = size; if (remove) { - wp_struct.mode = UFFDIO_WRITEPROTECT_MODE_DONTWAKE; + wp_struct.mode = 0; } else { wp_struct.mode = UFFDIO_WRITEPROTECT_MODE_WP; }