From nobody Tue Oct 7 20:22:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561687514; cv=none; d=zoho.com; s=zohoarc; b=Wlcmbj2qFGoJfThThRaoqqz2Be5tvDFHN5QpPHS29WViaVdUKg5OxRU31KWtLpaPTPeFbuJxDrw4jJ6MWAiUIZSt8EPWi8vQwoQY8RbN2Oopg2GVQHWW2iP5APhXThVy4SSeZYEEKYwMVsQsfFCJLJ7alnV/d2FJGBUf6pnEx9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561687514; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pXmv+n36bUkPxsHXKPAY0bqz9I+J1tPA2Rbam5u3vLM=; b=aN1WgTXT92dBJCgsFavgKtxiLOwqWACzUvqiqBeak+aw6H90bQur8j+ksam5zg1RzEzAt/E5gVR7btl6ArVwC2yYRs8smqGe7ZTqL4oWk3+gIk1rIxXoW0e4OpVntJDQUgQf5Eztue+rKzqxQHyu8Sq6lgHy7EXdG6nI7T4TMxQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561687514379179.65921535424195; Thu, 27 Jun 2019 19:05:14 -0700 (PDT) Received: from localhost ([::1]:55648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hggGB-0000IV-V5 for importer@patchew.org; Thu, 27 Jun 2019 22:05:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50004) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgg8J-0000kR-8j for qemu-devel@nongnu.org; Thu, 27 Jun 2019 21:57:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgg8H-0000Wv-VV for qemu-devel@nongnu.org; Thu, 27 Jun 2019 21:56:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgg8G-0000Nv-FJ for qemu-devel@nongnu.org; Thu, 27 Jun 2019 21:56:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04CD630820E6; Fri, 28 Jun 2019 01:56:54 +0000 (UTC) Received: from localhost (ovpn-116-7.gru2.redhat.com [10.97.116.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7754610013D9; Fri, 28 Jun 2019 01:56:53 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Marcel Apfelbaum Date: Thu, 27 Jun 2019 22:55:54 -0300 Message-Id: <20190628015606.32107-18-ehabkost@redhat.com> In-Reply-To: <20190628015606.32107-1-ehabkost@redhat.com> References: <20190628015606.32107-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 28 Jun 2019 01:56:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/29] numa: deprecate 'mem' parameter of '-numa node' option 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: Paolo Bonzini , Igor Mammedov , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov The parameter allows to configure fake NUMA topology where guest VM simulates NUMA topology but not actually getting performance benefits from it. The same or better results could be achieved using 'memdev' parameter. Beside of unpredictable performance, '-numa node.mem' option has other issues when it's used with combination of -mem-path + + -mem-prealloc + memdev backends (pc-dimm), breaking binding of memdev backends since mem-path/mem-prealloc are global and affect the most of RAM allocations. It's possible to make memdevs and global -mem-path/mem-prealloc to play nicely together but that will just complicate already complicated code and add unobious ways it could break on 2 different memmory allocation pathes and their combinations. Instead of it, consolidate all guest RAM allocation over memdev which still allows to create fake NUMA configurations if desired and leaves one simplifyed code path to consider when it comes to guest RAM allocation. To achieve desired simplification deprecate 'mem' parameter as its ad-hoc partitioning of initial RAM MemoryRegion can't be translated to memdev based backend transparently to users and in compatible manner (migration wise). Later down the road that will allow to consolidate means of how guest RAM is allocated and would permit us to clean up quite a bit memory allocations and numa code, leaving only 'memdev' implementation in place. Signed-off-by: Igor Mammedov Message-Id: <1559205199-233510-3-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- numa.c | 2 ++ qemu-deprecated.texi | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/numa.c b/numa.c index 7594eb5a7e..7d449c7e95 100644 --- a/numa.c +++ b/numa.c @@ -122,6 +122,8 @@ static void parse_numa_node(MachineState *ms, NumaNodeO= ptions *node, =20 if (node->has_mem) { numa_info[nodenr].node_mem =3D node->mem; + warn_report("Parameter -numa node,mem is deprecated," + " use -numa node,memdev instead"); } if (node->has_memdev) { Object *o; diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index df04f2840b..44c9a95966 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -88,6 +88,22 @@ The @code{-realtime mlock=3Don|off} argument has been re= placed by the The ``-virtfs_synth'' argument is now deprecated. Please use ``-fsdev synt= h'' and ``-device virtio-9p-...'' instead. =20 +@subsection -numa node,mem=3D@var{size} (since 4.1) + +The parameter @option{mem} of @option{-numa node} is used to assign a part= of +guest RAM to a NUMA node. But when using it, it's impossible to manage spe= cified +RAM chunk on the host side (like bind it to a host node, setting bind poli= cy, ...), +so guest end-ups with the fake NUMA configuration with suboptiomal perform= ance. +However since 2014 there is an alternative way to assign RAM to a NUMA node +using parameter @option{memdev}, which does the same as @option{mem} and a= dds +means to actualy manage node RAM on the host side. Use parameter @option{m= emdev} +with @var{memory-backend-ram} backend as an replacement for parameter @opt= ion{mem} +to achieve the same fake NUMA effect or a properly configured +@var{memory-backend-file} backend to actually benefit from NUMA configurat= ion. +In future new machine versions will not accept the option but it will still +work with old machine types. User can check QAPI schema to see if the lega= cy +option is supported by looking at MachineInfo::numa-mem-supported property. + @section QEMU Machine Protocol (QMP) commands =20 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0) --=20 2.18.0.rc1.1.g3f1ff2140