From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLg6o-00016q-1P for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:18:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLg6e-0000FQ-GG for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:17:57 -0400 Date: Mon, 25 Aug 2014 00:18:11 +0200 From: "Michael S. Tsirkin" Message-ID: <1408918641-14167-2-git-send-email-mst@redhat.com> References: <1408918641-14167-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1408918641-14167-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 01/11] hostmem: set MPOL_MF_MOVE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Hu Tao , qemu-stable@nongnu.org, Anthony Liguori , Igor Mammedov , Paolo Bonzini When memory is allocated on a wrong node, MPOL_MF_STRICT doesn't move it - it just fails the allocation. A simple way to reproduce the failure is with mlock=on realtime feature. The code comment actually says: "ensure policy won't be ignored" so setting MPOL_MF_MOVE seems like a better way to do this. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin --- backends/hostmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index e7eec37..99e8f99 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -295,7 +295,7 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) /* ensure policy won't be ignored in case memory is preallocated * before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so * this doesn't catch hugepage case. */ - unsigned flags = MPOL_MF_STRICT; + unsigned flags = MPOL_MF_STRICT | MPOL_MF_MOVE; /* check for invalid host-nodes and policies and give more verbose * error messages than mbind(). */ -- MST