From patchwork Thu Jul 30 01:02:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 1338622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BHC8171hrz9sRX for ; Thu, 30 Jul 2020 11:12:48 +1000 (AEST) Received: from localhost ([::1]:39966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0x7k-0004pQ-9A for incoming@patchwork.ozlabs.org; Wed, 29 Jul 2020 21:12:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0x7U-0004pB-Dk for qemu-devel@nongnu.org; Wed, 29 Jul 2020 21:12:28 -0400 Received: from mga18.intel.com ([134.134.136.126]:15476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0x7R-0007vL-Lh for qemu-devel@nongnu.org; Wed, 29 Jul 2020 21:12:27 -0400 IronPort-SDR: Xn41st3Lb3tBigGy5iv+cqK0yC16w6ycD8EU9Or5V0RhlYjNNZCABjLvM52UxPQG2TOachgdEV R7b4uuR7ZuKw== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="139055715" X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208";a="139055715" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 18:12:20 -0700 IronPort-SDR: 51dGuBhdgg+xbxDmYkcmeWFTyEoO6TkqCGO2jXDPrTbnnq9wOovf9d4772n3GCKrH/tQZmRmro 6u7pgaNEwegw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208";a="313233873" Received: from dazhang1-mobile.sh.intel.com ([10.239.48.70]) by fmsmga004.fm.intel.com with ESMTP; 29 Jul 2020 18:12:18 -0700 From: Jingqi Liu To: Stefan Hajnoczi , Paolo Bonzini , Xiao Guangrong , Dan Williams Subject: [PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file Date: Thu, 30 Jul 2020 09:02:06 +0800 Message-Id: <20200730010206.47051-1-jingqi.liu@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: pass client-ip=134.134.136.126; envelope-from=jingqi.liu@intel.com; helo=mga18.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/29 21:12:20 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jingqi Liu , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" At the end of live migration, QEMU uses msync() to flush the data to the backend storage. When the backend file is a character device dax, the pages explicitly avoid the page cache. It will return failure from msync(). The following warning is output. "warning: qemu_ram_msync: failed to sync memory rangeā€œ So we add 'pmem=on' to avoid calling msync(), use the QEMU command line: -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G Reviewed-by: Stefan Hajnoczi Signed-off-by: Jingqi Liu Reviewed-by: Pankaj Gupta --- docs/nvdimm.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index c2c6e441b3..31048aff5e 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt @@ -243,6 +243,13 @@ use the QEMU command line: -object memory-backend-file,id=nv_mem,mem-path=/XXX/yyy,size=4G,pmem=on +At the end of live migration, QEMU uses msync() to flush the data to the +backend storage. When the backend file is a character device dax, the pages +explicitly avoid the page cache. It will return failure from msync(). +So we add 'pmem=on' to avoid calling msync(), use the QEMU command line: + + -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G + References ----------